Skip to content
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

Error when loading pretrained SCT #20

Open
glimmer16 opened this issue Nov 4, 2023 · 2 comments
Open

Error when loading pretrained SCT #20

glimmer16 opened this issue Nov 4, 2023 · 2 comments

Comments

@glimmer16
Copy link

Hi, I met this error when running test_video_frame.py:

Traceback (most recent call last):
  File "test_video_frame.py", line 120, in <module>
    SCT.load_state_dict(torch.load(args.SCT))
  File "D:\Anaconda\envs\CCPL\lib\site-packages\torch\nn\modules\module.py", line 1407, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for SCT:
        Unexpected key(s) in state_dict: "cnet.4.weight", "cnet.4.bias", "snet.4.weight", "snet.4.bias".
        size mismatch for cnet.0.weight: copying a param with shape torch.Size([256, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([128, 256, 1, 1]).
        size mismatch for cnet.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).    
        size mismatch for cnet.2.weight: copying a param with shape torch.Size([128, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([32, 128, 1, 1]).
        size mismatch for cnet.2.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([32]).     
        size mismatch for snet.0.weight: copying a param with shape torch.Size([256, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 256, 3, 3]).
        size mismatch for snet.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).    
        size mismatch for snet.2.weight: copying a param with shape torch.Size([128, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 128, 1, 1]).
        size mismatch for snet.2.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([32]).     
        size mismatch for uncompress.weight: copying a param with shape torch.Size([512, 32, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 32, 1, 1]).
        size mismatch for uncompress.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([256]).

It seems like something went wrong when loading the pretrained SCT, so how can I fix it?

@JarrentWu1031
Copy link
Owner

I think you might have loaded the wrong checkpoint during testing. Make sure that the checkpoint corresponds to the --testing_mode config.

@Zombiessss
Copy link

artistic需要写成art才可以,作者在源码里面简写了,否则会被当成photo分支来处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants