yang-song / score_sde_pytorch

PyTorch implementation for Score-Based Generative Modeling through Stochastic Differential Equations (ICLR 2021, Oral)
https://arxiv.org/abs/2011.13456
Apache License 2.0
1.58k stars 295 forks source link

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

Open Richardhrz opened 1 year ago

Richardhrz commented 1 year ago

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 commented 1 year ago

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

youzhaoyirinide commented 11 months ago

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

Richardhrz commented 11 months ago

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