yuanyao366 / PRP

Apache License 2.0
40 stars 10 forks source link

Error when running ft_classfy.py #10

Closed falguni7 closed 1 year ago

falguni7 commented 1 year ago

Hi, I am facing an issue trying to run the finetuning task for PRP.

Exact Command used: python ft_classfy.py --gpu 0 --model_name c3d --pre_path 0 --split 1

The error is added as image attachment image

Steps before running this command: 1) The environment contains the more recent versions of packages 2) Modified dataset locations throughout the project according to my folder structure 3) With these changes, training on pretext task worked fine. Ran command: python3 train_predict.py --gpu 0 --epoch 300 --model_name c3d (Due to resource restriction, terminated after 147 epochs) 3) Added the path to the best model in file ft_classfy.py in pretrain_path0. From the output text file, it seems that this is best model location is being picked up as the model.

Solutions attempted: 1) To make sure the issue is not due to train_predict terminating before completing 300 epochs, I ran it for 2 epochs and tried with the best model obtained there too. 2) Similar error first occurred with the mode attribute when the code hit the part "if self.mode == 'train'" in the class ClassifyDataSet(data.Dataset) in predict_dataset.py. This got resolved once I moved the self.mode=mode above the said condition check. 3) To me, the attribute error regarding dataset looked like an issue of child class not having the attributes of the parent, so I also tried super().init() and super().init(*args, **kwargs) without any success.

Can you please advise regarding this, specially if I have missed any step after running the train_predict? Is there any other area of the project which is to be modifed to add the pretrained model path apart from pretrain_path0 in ft_classfy.py? I have also added a snippet with the last part of the output file (separate from the error file) image

Please let me know if any other information would be helpful. Thank you in advance.

yuanyao366 commented 1 year ago

This seems to be a spelling error in line 224 of predict_dataset.py. So please try to change "if self.dataset == 'HMDB-51'" to "if self.data_name == 'HMDB-51'“.

falguni7 commented 1 year ago

Thank you. The change resolved this issue