-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running test_on_video.py encountered "unexpected keyword argument 'input_shape'" error #3
Comments
the same problem |
There were several variable issues with the extract_frames.py. I have opened a pull request for that. |
another error after the modification |
Had the same issue @WangZhaoxue , did anyone run this project besides the author? |
I have successfully set up the environment and run the code. (Anaconda3-2019.03 python=3.6 pytorch 1.1.0) There are some typo errors in this repo. Also, make sure the extraction process is completed without error. |
Thank you @WangZhaoxue for your help. I made the minor changes and still have the same error, but I must use PyTorch 1.2 or 1.3 and I think that´s the issue why the loaded can´t load. I try to fix it and response if it´s works. Missing key(s) in state_dict: "lstm.lstm.weight_ih_l0_reverse", "lstm.lstm.weight_hh_l0_reverse", "lstm.lstm.bias_ih_l0_reverse", "lstm.lstm.bias_hh_l0_reverse", "output_layers.0.weight", "output_layers.0.bias", "output_layers.1.weight", "output_layers.1.bias".... |
Check out this issue. They found a solution for this error. It seems that you need to edit the name of the layers and add an attention layer to the pre trained model. I'll try it out later today and update here if I was able to advance or not. |
@nicholasguimaraes could you tell the solution for this problem |
Hello @sathees07, I still didn't try testing the pre trained model but if you want to load the model provided by erik you will need to update the names of the layers in the state_dict. Also, the pretrained model does not have an attention layer so, it seems that you should add that when fixing the state_dict. Here is a link where you can check how to access the names of the layers of your model through its state_dict. https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict |
Thank you @nicholasguimaraes i will check this |
Did you solve this problem? |
No @js-kang |
python3 test_on_video.py --video_path data/UCF-101/SoccerPenalty/v_SoccerPenalty_g01_c01.avi --checkpoint_model model_checkpoints/ConvLSTM_150.pth
Namespace(channels=3, checkpoint_model='model_checkpoints/ConvLSTM_150.pth', dataset_path='data/UCF-101-frames', image_dim=112, latent_dim=512, video_path='data/UCF-101/SoccerPenalty/v_SoccerPenalty_g01_c01.avi')
Traceback (most recent call last):
File "test_on_video.py", line 41, in
model = ConvLSTM(input_shape=input_shape, num_classes=len(labels), latent_dim=opt.latent_dim)
TypeError: init() got an unexpected keyword argument 'input_shape'
The text was updated successfully, but these errors were encountered: