mmpretrain
mmpretrain copied to clipboard
help me.
2022-04-06 19:17:39,308 - mmcls - INFO - Set random seed to 0, deterministic: True
2022-04-06 19:17:39,590 - mmcls - INFO - initialize ImageClassifier with init_cfg [{'type': 'TruncNormal', 'layer': 'Linear', 'std': 0.02, 'bias': 0.0}, {'type': 'Constant', 'layer': 'LayerNorm', 'val': 1.0, 'bias': 0.0}]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 52, in build_from_cfg
return obj_cls(**args)
File "/content/mmclassification/mmcls/datasets/imagenet.py", line 1034, in __init__
file_client_args=file_client_args)
File "/content/mmclassification/mmcls/datasets/custom.py", line 170, in __init__
test_mode=test_mode)
File "/content/mmclassification/mmcls/datasets/base_dataset.py", line 51, in __init__
self.data_infos = self.load_annotations()
File "/content/mmclassification/mmcls/datasets/custom.py", line 211, in load_annotations
samples = self._find_samples()
File "/content/mmclassification/mmcls/datasets/custom.py", line 176, in _find_samples
classes, folder_to_idx = find_folders(self.data_prefix, file_client)
File "/content/mmclassification/mmcls/datasets/custom.py", line 31, in find_folders
recursive=False,
File "/usr/local/lib/python3.7/dist-packages/mmcv/fileio/file_client.py", line 1149, in list_dir_or_file
suffix, recursive)
File "/usr/local/lib/python3.7/dist-packages/mmcv/fileio/file_client.py", line 673, in _list_dir_or_file
for entry in os.scandir(dir_path):
FileNotFoundError: [Errno 2] No such file or directory: 'data/imagenet/train'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/train.py", line 194, in <module>
main()
File "tools/train.py", line 167, in main
datasets = [build_dataset(cfg.data.train)]
File "/content/mmclassification/mmcls/datasets/builder.py", line 50, in build_dataset
dataset = build_from_cfg(cfg, DATASETS, default_args)
File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 55, in build_from_cfg
raise type(e)(f'{obj_cls.__name__}: {e}')
FileNotFoundError: ImageNet: [Errno 2] No such file or directory: 'data/imagenet/train'
Looks like you don't have dataset folder
https://programmer.help/blogs/start-a-classification-task-using-swing-transformer-in-mmclassification.html#1.%20MMClassification%E5%AE%89%E8%A3%85 .Start a classification task using swing transformer in MMClassification
i don't know where imagenet dataset in code of this link. Can U give me link code of Swin Transformer fine tuning.
Here is the colab tutorial
Please notice the Prepare data section and the Create a new config file section
help me
!python tools/test.py ./configs/swin_transformer/swin-tiny_cats-dogs.py work_dirs/swin-tiny_cats-dogs/latest.pth --metrics=accuracy --metric-options=topk=1
/usr/local/lib/python3.7/dist-packages/mmcv/cnn/bricks/transformer.py:33: UserWarning: Fail to import MultiScaleDeformableAttention from mmcv.ops.multi_scale_deform_attn, You should install mmcv-full if you need this module.
warnings.warn('Fail to import MultiScaleDeformableAttention from '
/content/mmclassification/mmcls/utils/setup_env.py:33: UserWarning: Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
f'Setting OMP_NUM_THREADS environment variable for each process '
/content/mmclassification/mmcls/utils/setup_env.py:43: UserWarning: Setting MKL_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
f'Setting MKL_NUM_THREADS environment variable for each process '
load checkpoint from local path: work_dirs/swin-tiny_cats-dogs/latest.pth
Traceback (most recent call last):
File "tools/test.py", line 243, in
This issue will be closed as it is inactive, feel free to re-open it if necessary.