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 while loading model #4

Open
jmsweng opened this issue Jun 13, 2024 · 0 comments
Open

Error while loading model #4

jmsweng opened this issue Jun 13, 2024 · 0 comments

Comments

@jmsweng
Copy link

jmsweng commented Jun 13, 2024

Attempting to load a model using the --load_model_num parameter added to the first usage example

python train.py --gpu 0 --data cylinder --num_sensors 8 --training_frames 50 --cons False --seed 123 --enc_preproc 16 --dec_num_latent_channels 16 --enc_num_latent_channels 16 --num_latents 256 --dec_preproc_ch 16 --test False

returns the following error:

Traceback (most recent call last):
  File "C:\Users\jmswe\Documents\Senseiver-main\train.py", line 79, in <module>
    main()
  File "C:\Users\jmswe\Documents\Senseiver-main\train.py", line 36, in main
    model = model.load_from_checkpoint(model_loc,
  File "C:\Users\jmswe\mambaforge\lib\site-packages\pytorch_lightning\utilities\model_helpers.py", line 121, in wrapper
    raise TypeError(
TypeError: The classmethod `Senseiver.load_from_checkpoint` cannot be called on an instance. Please call it on the class type and make sure the return value is used.

Changing line 36 in train.py from

model = model.load_from_checkpoint(model_loc, **encoder_config, **decoder_config, **data_config)

to

model = Senseiver.load_from_checkpoint(model_loc, **encoder_config, **decoder_config, **data_config)

appears to fix the problem.

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

1 participant