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: "No object named 'DRCTModel' found in 'model' registry!" #8

Open
amirafshari opened this issue May 19, 2024 · 2 comments
Open

Comments

@amirafshari
Copy link

amirafshari commented May 19, 2024

Hi,

I can train the model with the following command

python drct/train.py -opt options/train/train_DRCT_SRx4_from_scratch.yml

but, I can't test my model with this command:

python drct/test.py -opt options/test/DRCT_SRx4_ImageNet-pretrain.yml

and I get the following error:

File "../python3.8/site-packages/basicsr/utils/registry.py", line 65, in get

  raise KeyError(f"No object named '{name}' found in '{self._name}' registry!")
KeyError: "No object named 'DRCTModel' found in 'model' registry!"
@ming053l
Copy link
Owner

Hi,

We encountered this issue during testing, and it may be due to the register being referenced repeatedly when you installed the "hat" package. There are two possible solutions:

(1) If you have already installed hat, please try uninstalling it and resolving any potential bugs. This package might not be necessary.
(2) Try to copy-paste the model-related code into train.py or test.py without importing the related package. Although this approach is inefficient and somewhat messy, it is feasible.

@amirafshari
Copy link
Author

You just need to change these lines in test.py file

import hat.archs
import hat.data
import hat.models

to

import drct.archs
import drct.data
import drct.models

just like train.py

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