3D-ResNets-PyTorch icon indicating copy to clipboard operation
3D-ResNets-PyTorch copied to clipboard

prediction using pretrained model

Open kpis-msa opened this issue 4 years ago • 4 comments

I tried to predict using pretrained model as follows:

’ python main.py --root_path data --video_path mit_videos/a064-0224C.mp4 --annotation_path actionlist.csv --result_path results --dataset mit --resume_path results/r3d50_M_200ep.pth --model_depth 50 --n_classes 339 --n_threads 4 --no_ train --no_val --inference --output_topk 5 --inference_batch_size 1

here

a064-0224C.mp4 is one of the videos of the stair center. actionlist.csv is the caption file of the stair center. r3d50_M_200ep.pth is the pretrained model name.

Then, the output message from the command is as follows:

Traceback (most recent call last): File "main.py", line 415, in opt = get_opt() File "main.py", line 80, in get_opt with (opt.result_path / 'opts.json').open('w') as opt_file: File "/home/xxxxxxxx/anaconda3/lib/python3.8/pathlib.py", line 1218, in open return io.open(self, mode, buffering, encoding, errors, newline, File "/home/xxxxxxxx/anaconda3/lib/python3.8/pathlib.py", line 1074, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: 'data/results/opts.json'

What's wrong? How do I fix the bug?

Best Regards,

kpis-msa avatar Oct 26 '20 07:10 kpis-msa

Do you have a opts.json file? And if so what is its path location? Is it at 'data/results/opts.json'?

anthonymiyoro avatar Nov 05 '20 11:11 anthonymiyoro

Thank you very much for your response. BTW, I don't have any idea for opts.json. Please tell me what is it and where I can get it.

I'm waiting for your reply.

kpis-msa avatar Nov 09 '20 07:11 kpis-msa

Hello, The opts.json file will be rewritten by the main.py routine, it's a persistent file for you to know what options you've used to run your code. Try just creating an empty opts.json in the path 'data/results/'. image

guilhermesurek avatar Nov 09 '20 12:11 guilhermesurek

Thank you.

kpis-msa avatar Nov 16 '20 09:11 kpis-msa