open-mmlab / mmaction

An open-source toolbox for action understanding based on PyTorch
https://open-mmlab.github.io/
Apache License 2.0
1.86k stars 352 forks source link

Error While Using Test Recognizer.py On UCF101(Using Colab)After Extracting RGB Frames Only! #129

Closed lakshaymehra closed 4 years ago

lakshaymehra commented 4 years ago

I ran: !python tools/test_recognizer.py configs/ucf101/tsn_rgb_bninception.py modelzoo/tsn_2d_rgb_bninception_seg3_f1s1_b32_g8-98160339.pth

Output(Error): Traceback (most recent call last): File "tools/test_recognizer.py", line 181, in main() File "tools/test_recognizer.py", line 140, in main raise NotImplementedError("By default, we use distributed testing, so that launcher should be pytorch") NotImplementedError: By default, we use distributed testing, so that launcher should be pytorch

Notes: I have installed all the required packages as mentioned in install.md Kindly help as soon as possible as I have been stuck here for more than a week... Thanks in advance!

kennymckormick commented 4 years ago

Sorry, that's because of the inconsistency in our last update. Now the testing command in GETTING_STARTED.md is updated, you can try the new command.

lakshaymehra commented 4 years ago

Thanks for your response.

I am running:

!bash ./tools/dist_test_recognizer.sh configs/ucf101/tsn_rgb_bninception.py tsn_2d_rgb_bninception_seg3_f1s1_b32_g8-98160339.pth 2

(I AM USING 2 SINCE RAM ON COLAB GETS PRETTY QUICKLY USED UP IF I SPECIFY 8)

However,I am getting this new error:


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.


The model and loaded state dict do not match exactly

unexpected key in source state_dict: fc.weight, fc.bias

Traceback (most recent call last): File "./tools/test_recognizer.py", line 182, in main() File "./tools/test_recognizer.py", line 154, in main load_checkpoint(model, args.checkpoint, map_location='cpu') File "/usr/local/lib/python3.7/site-packages/mmcv-0.2.16-py3.7-linux-x86_64.egg/mmcv/runner/checkpoint.py", line 168, in load_checkpoint raise IOError('{} is not a checkpoint file'.format(filename)) OSError: tsn_2d_rgb_bninception_seg3_f1s1_b32_g8-98160339.pth is not a checkpoint file Traceback (most recent call last): File "./tools/test_recognizer.py", line 182, in main() File "./tools/test_recognizer.py", line 154, in main load_checkpoint(model, args.checkpoint, map_location='cpu') File "/usr/local/lib/python3.7/site-packages/mmcv-0.2.16-py3.7-linux-x86_64.egg/mmcv/runner/checkpoint.py", line 168, in load_checkpoint raise IOError('{} is not a checkpoint file'.format(filename)) OSError: tsn_2d_rgb_bninception_seg3_f1s1_b32_g8-98160339.pth is not a checkpoint file Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/site-packages/torch/distributed/launch.py", line 263, in main() File "/usr/local/lib/python3.7/site-packages/torch/distributed/launch.py", line 259, in main cmd=cmd) subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-u', './tools/test_recognizer.py', '--local_rank=1', 'configs/ucf101/tsn_rgb_bninception.py', 'tsn_2d_rgb_bninception_seg3_f1s1_b32_g8-98160339.pth', '--launcher', 'pytorch']' died with <Signals.SIGSEGV: 11>.

kennymckormick commented 4 years ago

Hi, lakshaymehra, Seems that you haven't downloaded the checkpoint file yet, please first download it with link in model zoo.

lakshaymehra commented 4 years ago

Hi,thanks for the response.

There was a problem with the directory in which the checkpoint file was saved but I rectified it.

However,even after testing is completed,there is an error being displayed.Can you tell me how it can be rectified?

!bash ./tools/dist_test_recognizer.sh configs/ucf101/tsn_rgb_bninception.py tsn_2d_rgb_bninception_seg3_f1s1_b32_g8-98160339.pth 1

The model and loaded state dict do not match exactly

unexpected key in source state_dict: fc.weight, fc.bias

rank 0, data_batch 0 rank 0, begin collect results rank 0 begin dump rank 0 finished dump writing results to default.pkl Averaging score over 1 clips without softmax (ie, raw) Mean Class Accuracy = 66.67 Top-1 Accuracy = 65.00 Top-5 Accuracy = 100.00 Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/site-packages/torch/distributed/launch.py", line 263, in main() File "/usr/local/lib/python3.7/site-packages/torch/distributed/launch.py", line 259, in main cmd=cmd) subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-u', 'tools/test_recognizer.py', '--local_rank=0', 'configs/ucf101/tsn_rgb_bninception.py', 'modelzoo/tsn_2d_rgb_bninception_seg3_f1s1_b32_g8-98160339.pth', '--launcher', 'pytorch']' died with <Signals.SIGSEGV: 11>.

kennymckormick commented 4 years ago

I didn't get this error on my linux machine. You can try this codabase on a linux machine to see if this error still exists.