score_sde_pytorch icon indicating copy to clipboard operation
score_sde_pytorch copied to clipboard

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

Open Richardhrz opened this issue 2 years ago • 3 comments

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 avatar Jul 01 '23 16:07 Richardhrz

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

Richardhrz avatar Jul 01 '23 16:07 Richardhrz

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

youzhaoyirinide avatar Jul 11 '23 07:07 youzhaoyirinide

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

Richardhrz avatar Jul 11 '23 16:07 Richardhrz