slowfast-networks-pytorch icon indicating copy to clipboard operation
slowfast-networks-pytorch copied to clipboard

test.py

Open yangjinghit opened this issue 4 years ago • 2 comments

@mbiparva how to use test.py? after I trained, I tried python test.py -i 20200812_135411_361917 -p 039, but failed └── 20200812_135411_361917 ├── 004.pth ├── 009.pth ├── 014.pth ├── 019.pth ├── 024.pth ├── 029.pth ├── 034.pth └── 039.pth

yangjinghit avatar Aug 13 '20 01:08 yangjinghit

*** started @ 2020-08-13 14:44:19.251603 Traceback (most recent call last): File "test.py", line 87, in main() File "test.py", line 58, in main epoch_loop.main() File "/home/ripple/anaconda3/work/slowfast-networks-pytorch/tools/epoch_loop.py", line 66, in main self.setup_net() File "/home/ripple/anaconda3/work/slowfast-networks-pytorch/tools/epoch_loop.py", line 74, in setup_net self.net = TwoStreamNet(self.device) File "/home/ripple/anaconda3/work/slowfast-networks-pytorch/lib/netwrapper/two_stream_net.py", line 36, in init self.create_load(device) File "/home/ripple/anaconda3/work/slowfast-networks-pytorch/lib/netwrapper/two_stream_net.py", line 50, in create_load self.load(cfg.PT_PATH) File "/home/ripple/anaconda3/work/slowfast-networks-pytorch/lib/netwrapper/two_stream_net.py", line 113, in load self.load_state_dict(torch.load(file_path)) File "/home/ripple/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 830, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for TwoStreamNet: Unexpected key(s) in state_dict: "fc.weight".

yangjinghit avatar Aug 13 '20 06:08 yangjinghit

i got exactly the same error as @yangjinghit, could you please give some ideas how to fix it? @mbiparva

zenoZhao avatar Aug 06 '21 05:08 zenoZhao