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

KeyError: 'ncsnpp' of get_models() in models.utils #45

Open
Richardhrz opened this issue Jul 1, 2023 · 3 comments
Open

KeyError: 'ncsnpp' of get_models() in models.utils #45

Richardhrz opened this issue Jul 1, 2023 · 3 comments

Comments

@Richardhrz
Copy link

Richardhrz commented Jul 1, 2023

hello author,
when I tried to run the checkpoint, an error occured:

KeyError Traceback (most recent call last)
Cell In[12], line 34
30 inverse_scaler = datasets.get_data_inverse_scaler(config)
32 # print(config)
---> 34 score_model = mutils.create_model(config)
36 optimizer = get_optimizer(config, score_model.parameters())
37 ema = ExponentialMovingAverage(score_model.parameters(),
38 decay=config.model.ema_rate)

File /score_sde_pytorch-main/models/utils.py:94, in create_model(config)
92 model_name = config.model.name
93 print(model_name) # ncsnpp
---> 94 score_model = get_model(model_name)(config)
95 score_model = score_model.to(config.device)
96 score_model = torch.nn.DataParallel(score_model)

File /score_sde_pytorch-main/models/utils.py:48, in get_model(name)
46 def get_model(name):
47 print(_MODELS)
---> 48 return _MODELS[name]
52 def get_sigmas(config):

KeyError: 'ncsnpp'

any suggestion would be grateful.

@Richardhrz
Copy link
Author

_MODELS={} is empty, so return _MODELS[name] has nothing to do. what form of data should be put int the dict?

@youzhaoyirinide
Copy link

Hello, I meet the same issue as yours, could you tell me how to do if you resolve it? Thank you so much.

@Richardhrz
Copy link
Author

import all the models in the jupyter file. _MODEL{} is not a global variable.

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

2 participants