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

FileNotFoundError: [Errno 2] No such file or directory: 'data/ucf101/ucf101_train_split_{1,2,3}_rawframes.txt' #105

Closed
zjykzj opened this issue Aug 12, 2020 · 5 comments · Fixed by #106

Comments

@zjykzj
Copy link

zjykzj commented Aug 12, 2020

hi mmaction2, i met this problem several times, use UCF101 dataset to train, use default config file

$ CUDA_VISIBLE_DEVICES=1 python tools/train.py configs/recognition/tsn/tsn_r50_1x1x3_80e_ucf101_rgb.py

refer to #101 , add start_index=0 to data dict

but there was a problem

2020-08-12 09:20:54,393 - mmaction - INFO - These parameters in pretrained checkpoint are not loaded: {'fc.bias', 'fc.weight'}
Traceback (most recent call last):
  File "tools/train.py", line 146, in <module>
    main()
  File "tools/train.py", line 125, in main
    datasets = [build_dataset(cfg.data.train)]
  File "/home/zj/zhonglian/mmaction2/mmaction/datasets/builder.py", line 39, in build_dataset
    dataset = build_from_cfg(cfg, DATASETS, default_args)
  File "/home/zj/zhonglian/mmcv/mmcv/utils/registry.py", line 167, in build_from_cfg
    return obj_cls(**args)
  File "/home/zj/zhonglian/mmaction2/mmaction/datasets/rawframe_dataset.py", line 93, in __init__
    multi_class, num_classes, start_index, modality)
  File "/home/zj/zhonglian/mmaction2/mmaction/datasets/base.py", line 63, in __init__
    self.video_infos = self.load_annotations()
  File "/home/zj/zhonglian/mmaction2/mmaction/datasets/rawframe_dataset.py", line 98, in load_annotations
    with open(self.ann_file, 'r') as fin:
FileNotFoundError: [Errno 2] No such file or directory: 'data/ucf101/ucf101_train_split_{1,2,3}_rawframes.txt'

when i modified this file path in config file

# ann_file_train = 'data/ucf101/ucf101_train_split_{1,2,3}_rawframes.txt'
ann_file_train = 'data/ucf101/ucf101_train_split_1_rawframes.txt'

ok, everything is fine. I wonder if it needs to be changed every time, after trained use 2 to continue train, because there has a config

work_dir = './work_dirs/tsn_r50_1x1x3_80e_ucf101_rgb/'
@innerlee
Copy link
Contributor

there was a f missing

@zjykzj
Copy link
Author

zjykzj commented Aug 12, 2020

there was a f missing

hi @innerlee , thank you for you reply. i check the pull, and modified config like this

split = 1
ann_file_train = f'data/ucf101/ucf101_train_split_{split}_rawframes.txt'
ann_file_val = f'data/ucf101/ucf101_val_split_{split}_rawframes.txt'
ann_file_test = f'data/ucf101/ucf101_val_split_{split}_rawframes.txt'

it worked but i don't know after split=1 trained it will automated woked for splited=2/3

Is this rule written in the code? I would appreciate it if I could get your answer.

@innerlee
Copy link
Contributor

could you explain a little bit what's "will automated woked for splited=2/3"?
if set split=1, then the training will load annotations of split1, so the model will be using split1's training data and validation data.
after that, if you want to train another model using split2, then set split=2 and train a new model

@innerlee
Copy link
Contributor

oh there is a culprit. it's better to change the workdir so that weights do not get overridden

@zjykzj
Copy link
Author

zjykzj commented Aug 12, 2020

could you explain a little bit what's "will automated woked for splited=2/3"?
if set split=1, then the training will load annotations of split1, so the model will be using split1's training data and validation data.
after that, if you want to train another model using split2, then set split=2 and train a new model

haha, because the config file is written like

..{1,2,3}_rawframes.txt'

so i think there will automated continue train. i check the code in mmaction/data/rawframe_dataset.py

        with open(self.ann_file, 'r') as fin:

ok, i know it, thank you very much

@zjykzj zjykzj closed this as completed Aug 12, 2020
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

Successfully merging a pull request may close this issue.

2 participants