Skip to content

Error of opai_predictor.py using evidence-based model #23

@kakyungkim

Description

@kakyungkim

I met the error for running opai_predictor.py using evidence-based model as below.


Traceback (most recent call last):
File "OPAI/scripts/opai_predictor.py", line 92, in
main()
File "OPAI/scripts/opai_predictor.py", line 58, in main
disNet.load_state_dict( torch.load( model_path, map_location=torch.device(device) ) )
File "../anaconda3/envs/opai/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1483, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for evs_CNN1d_5layer:
size mismatch for linear1.0.weight: copying a param with shape torch.Size([2, 13000]) from checkpoint, the shape in current model is torch.Size([2, 8400]).

It might be due to size mismatch runtime error when trying to load a PyTorch Model, so I tried to from change strict: bool = True to strict: bool = False of 'load_state_dict' function; however, I met the same error.
Can you help me to solve the problem? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions