Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #9

Open
xiaoyouzi12 opened this issue Jun 29, 2022 · 3 comments
Open

IndexError: list index out of range #9

xiaoyouzi12 opened this issue Jun 29, 2022 · 3 comments

Comments

@xiaoyouzi12
Copy link

xiaoyouzi12 commented Jun 29, 2022

您好,我在特征提取过程中可以正常运行,但是到最后保存特征时会报错:

Attempting to read from directory: C:\Users\10376.MMSA-FET/tmp\video_0001_0010
Device or file opened
Starting tracking
Reading the MTCNN face detector from: E:\openface\OpenFace_2.2.0_win_x64\model/mtcnn_detector/MTCNN_detector.txt
Reading the PNet module from: E:\openface\OpenFace_2.2.0_win_x64\model/mtcnn_detector\PNet.dat
Reading the RNet module from: E:\openface\OpenFace_2.2.0_win_x64\model/mtcnn_detector\RNet.dat
Reading the ONet module from: E:\openface\OpenFace_2.2.0_win_x64\model/mtcnn_detector\ONet.dat
0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Closing output recorder
Closing input reader
Closed successfully
Postprocessing the Action Unit predictions
100%|██████████| 1/1 [00:25<00:00, 25.23s/it]
MMSA-FET - An Error Occured:
Traceback (most recent call last):
File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 449, in run_dataset
final_data[mode][item] = np.array([data[item][v] for v in indexes])
File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 449, in
final_data[mode][item] = np.array([data[item][v] for v in indexes])
IndexError: list index out of range
MMSA-FET - Removing temporary files.
Traceback (most recent call last):
File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 487, in
feature = fet.run_dataset(dataset_dir="E:\code\MMSA-FET-master\src\MSA_FET\SIMS", out_file="E:\code\MMSA-FET-master\src\output/feature.pkl")
File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 483, in run_dataset
raise e
File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 449, in run_dataset
final_data[mode][item] = np.array([data[item][v] for v in indexes])
File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 449, in
final_data[mode][item] = np.array([data[item][v] for v in indexes])
IndexError: list index out of range

我是在windows上运行的

@FlameSky-S
Copy link
Contributor

您好,我们无法复现这个问题。请问您是抽取的自定义数据集的特征吗?该数据集只有一条数据吗?

@AIzld
Copy link

AIzld commented Jun 7, 2023

您好,我在特征提取过程中可以正常运行,但是到最后保存特征时会报错:

Attempting to read from directory: C:\Users\10376.MMSA-FET/tmp\video_0001_0010 Device or file opened Starting tracking Reading the MTCNN face detector from: E:\openface\OpenFace_2.2.0_win_x64\model/mtcnn_detector/MTCNN_detector.txt Reading the PNet module from: E:\openface\OpenFace_2.2.0_win_x64\model/mtcnn_detector\PNet.dat Reading the RNet module from: E:\openface\OpenFace_2.2.0_win_x64\model/mtcnn_detector\RNet.dat Reading the ONet module from: E:\openface\OpenFace_2.2.0_win_x64\model/mtcnn_detector\ONet.dat 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Closing output recorder Closing input reader Closed successfully Postprocessing the Action Unit predictions 100%|██████████| 1/1 [00:25<00:00, 25.23s/it] MMSA-FET - An Error Occured: Traceback (most recent call last): File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 449, in run_dataset final_data[mode][item] = np.array([data[item][v] for v in indexes]) File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 449, in final_data[mode][item] = np.array([data[item][v] for v in indexes]) IndexError: list index out of range MMSA-FET - Removing temporary files. Traceback (most recent call last): File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 487, in feature = fet.run_dataset(dataset_dir="E:\code\MMSA-FET-master\src\MSA_FET\SIMS", out_file="E:\code\MMSA-FET-master\src\output/feature.pkl") File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 483, in run_dataset raise e File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 449, in run_dataset final_data[mode][item] = np.array([data[item][v] for v in indexes]) File "E:/code/MMSA-FET-master/src/MSA_FET/main.py", line 449, in final_data[mode][item] = np.array([data[item][v] for v in indexes]) IndexError: list index out of range

我是在windows上运行的

请问这个问题解决了么 我遇到了这个问题

@xlggzzz
Copy link

xlggzzz commented Jun 30, 2023

您好,我在Linux系统上提取MOSI数据集定制特征时多次遇到了这个错误,但程序还在继续运行!我不知道如何修复这个错误,这个越界是否会影响特征的抽取所以向您请教下!
我的原始代码如下:
from MSA_FET import run_dataset
if name == 'main':
# Extract audio features for MOSI using default aligned feature config
run_dataset(
config='aligned',
dataset_dir='/data1/lx/data/Raw/CMU-MOSI/',
out_file='/data1/lx/FET/feature_aligned.pkl',
# num_workers = 1
)
print("finished")
报错信息如下:
2023-06-30 18:03:14 - FET-Subprocess - PID:1768915 [ERROR] Ignore error and continue, see log for details.
2023-06-30 18:03:14 - FET-Subprocess - PID:1768915 [ERROR] index 32 is out of bounds for axis 0 with size 32
Traceback (most recent call last):
File "/data/lx/anaconda3/envs/msa/lib/python3.10/site-packages/MSA_FET/dataset.py", line 118, in extract_one
align_result = aligner.align_with_transcript(video_path, text)
File "/data/lx/anaconda3/envs/msa/lib/python3.10/site-packages/MSA_FET/aligners/wav2vec2.py", line 67, in align_with_transcript
segments = ctc_segmentation.determine_utterance_segments(config, utt_begin_indices, char_probs, timings, transcripts)
File "/data/lx/anaconda3/envs/msa/lib/python3.10/site-packages/ctc_segmentation/ctc_segmentation.py", line 391, in determine_utterance_segments
start = compute_time(utt_begin_indices[i], "begin")
File "/data/lx/anaconda3/envs/msa/lib/python3.10/site-packages/ctc_segmentation/ctc_segmentation.py", line 384, in compute_time
return max(timings[index + 1] - 0.5, middle)
IndexError: index 32 is out of bounds for axis 0 with size 32
程序执行完结果:
2023-06-30 18:21:49 - FET-Subprocess - PID:1765176 [ERROR] Ignore error and continue, see log for details.
2023-06-30 18:21:49 - FET-Subprocess - PID:1765176 [ERROR] index 53 is out of bounds for axis 0 with size 53
Traceback (most recent call last):
File "/data/lx/anaconda3/envs/msa/lib/python3.10/site-packages/MSA_FET/dataset.py", line 118, in extract_one
align_result = aligner.align_with_transcript(video_path, text)
File "/data/lx/anaconda3/envs/msa/lib/python3.10/site-packages/MSA_FET/aligners/wav2vec2.py", line 67, in align_with_transcript
segments = ctc_segmentation.determine_utterance_segments(config, utt_begin_indices, char_probs, timings, transcripts)
File "/data/lx/anaconda3/envs/msa/lib/python3.10/site-packages/ctc_segmentation/ctc_segmentation.py", line 391, in determine_utterance_segments
start = compute_time(utt_begin_indices[i], "begin")
File "/data/lx/anaconda3/envs/msa/lib/python3.10/site-packages/ctc_segmentation/ctc_segmentation.py", line 384, in compute_time
return max(timings[index + 1] - 0.5, middle)
IndexError: index 53 is out of bounds for axis 0 with size 53
100%|███████████████████████████████████████| 2199/2199 [42:00<00:00, 1.15s/it]
2023-06-30 18:27:49 - FET-Dataset - PID:1763448 [INFO] Feature file saved: '/data1/lx/FET/feature_aligned.pkl'.
2023-06-30 18:27:49 - FET-Dataset - PID:1763448 [INFO] Feature extraction complete!
Process finished with exit code 0

请教一下这个IndexError影响特征的提取吗?期待和感谢您的回复!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants