Open feifancoco opened 1 year ago
And display: "cannot import name 'Config' from 'mmcv' (unknown location)", how to handle it.
May I ask what caused the following error
Traceback (most recent call last):
File "/opt/home/hut/miniconda3/envs/pytorch18/lib/python3.9/site-packages/mmcv/utils/registry.py", line 52, in build from cfg
return obj_ cls(**args)
File "/opt/home/wk/APViT-main/mmcls/datasets/base_dataset.py", line 42, in init
self.data infos = self.load annotations()
File "/opt/home/wk/APViT-main/mmcls/datasets/raf.py", line 128, in load_ annotations
samples = [[i[0].replace('_aligned', ''), i[1]] for i in samples]
File "/opt/home/wk/APViT-main/mmcls/datasets/raf.py", line 128, in
samples = [[i[0].replace('_aligned', ''), i[1]] for i in samples]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/home/wk/APViT-main/train.py", line 160, in
main()
File "/opt/home/wk/APViT-main/train.py", line 135, in main
datasets = [build_dataset(cfg.data.train)]
File "/opt/home/wk/APViT-main/mmcls/datasets/builder.py", line 35, in build_ dataset
ds = build_ dataset(cfg['dataset'], default_args)
File "/opt/home/wk/APViT-main/mmcls/datasets/builder.py", line 39, in build_ dataset
dataset = build from cfg(cfg, DATASETS, default_args)
File "/opt/home/hut/miniconda3/envs/pytorch18/lib/python3.9/site-packages/mmcv/utils/registry.py", line 55, in build from cfg
raise type(e)(f'{obj_cls.name}: {e}')
IndexError: RAF: list index out of range
Traceback (most recent call last):
File "/opt/home/hut/miniconda3/envs/pytorch18/lib/python3.9/site-packages/mmcv/utils/registry.py", line 52, in build from cfg
return obj_ cls(**args)
File "/opt/home/wk/APViT-main/mmcls/datasets/base_dataset.py", line 42, in init
self.data infos = self.load annotations()
File "/opt/home/wk/APViT-main/mmcls/datasets/raf.py", line 128, in load_ annotations
samples = [[i[0].replace('_aligned', ''), i[1]] for i in samples]
File "/opt/home/wk/APViT-main/mmcls/datasets/raf.py", line 128, in
samples = [[i[0].replace('_aligned', ''), i[1]] for i in samples]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/home/wk/APViT-main/train.py", line 160, in
main()
File "/opt/home/wk/APViT-main/train.py", line 135, in main
datasets = [build_dataset(cfg.data.train)]
File "/opt/home/wk/APViT-main/mmcls/datasets/builder.py", line 35, in build_ dataset
ds = build_ dataset(cfg['dataset'], default_args)
File "/opt/home/wk/APViT-main/mmcls/datasets/builder.py", line 39, in build_ dataset
dataset = build from cfg(cfg, DATASETS, default_args)
File "/opt/home/hut/miniconda3/envs/pytorch18/lib/python3.9/site-packages/mmcv/utils/registry.py", line 55, in build from cfg
raise type(e)(f'{obj_cls.name}: {e}')
IndexError: RAF: list index out of range
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1)
Is it because of a dataset preparation error? I hope to receive your reply,and I would greatly appreciate it!
May I ask if the RAF-DB dataset you tested has been processed? In the dataset I obtained, the images of trian and test are in the same folder.
Yes, the images are aligned with MTCNN first. And the file structure should be organized to satisfy the dataloader. I will update the Readme file for better understand.
Hello, how can I run your code after I download it again? Do you need to fully install the installation prompts provided by the "MMClassification" and "PaddleClas" tool boxes? Do you need to install the folder 'mm2'? When I run 'Python - m torch. distributed. launch -- nproc_per_node=2 train. py configs/apvit/RAF. py -- launcher pytorch', there are errors: ModuleNotFoundError: No module named 'mmcv' and 'torch. distributed. final. multiprocessing. errors. ChildFailedError:' I would like to do some research based on your research and cite your paper. I hope to receive your reply.