video-classification-3d-cnn-pytorch icon indicating copy to clipboard operation
video-classification-3d-cnn-pytorch copied to clipboard

Unable to load resnext-101-kinetics.pth model

Open saurabhhssaurabh opened this issue 6 years ago • 5 comments

I run following command: python main.py --input ./input --video_root ./videos --output ./output.json --model_name resnext --model_depth 101 --model ./models/resnext-101-kinetics.pth --mode score

and got following error:

Traceback (most recent call last): File "main.py", line 24, in model_data = torch.load(opt.model) File "/home/saurabhr/.local/lib/python3.5/site-packages/torch/serialization.py", line 303, in load return _load(f, map_location, pickle_module) File "/home/saurabhr/.local/lib/python3.5/site-packages/torch/serialization.py", line 459, in _load magic_number = pickle_module.load(f) _pickle.UnpicklingError: invalid load key, ' '.

Python version: 3.5.2 torch version: 0.4.0 torchvision version: 0.2.1 cuda : 9.0

saurabhhssaurabh avatar Jun 13 '18 15:06 saurabhhssaurabh

The shortcut parameter is missing from your command. It may be the cause of the error. Try to add "--resnet_shortcut B" in the command.

thanasisDr avatar Jun 14 '18 09:06 thanasisDr

@thanasisDr I didn't help. Same error. I think pretrained model file has some problem.

saurabhhssaurabh avatar Jun 15 '18 05:06 saurabhhssaurabh

@saurabhhjjain Did you try loading any of the other resnext models? There's six of them.

rsomani95 avatar Jun 10 '19 06:06 rsomani95

No, I didn't

saurabhhssaurabh avatar Jun 10 '19 09:06 saurabhhssaurabh

The shortcut parameter is missing from your command. It may be the cause of the error. Try to add "--resnet_shortcut B" in the command.

thank you, it helps.

flzq avatar Aug 13 '20 08:08 flzq