HAT icon indicating copy to clipboard operation
HAT copied to clipboard

No object named 'HATModel' found in 'model' registry!"

Open Univercp opened this issue 3 years ago • 14 comments
trafficstars

Hello,when I train my custom dataset ,it will happens like:

E4IAYU_8BB VW P{P{CC_6L

No object named 'HATModel' found in 'model' registry!"

how can I slove it.

Univercp avatar Nov 03 '22 03:11 Univercp

https://github.com/XPixelGroup/HAT#installation

chxy95 avatar Nov 03 '22 04:11 chxy95

请问这个问题解决了吗,我匹配了requirement.txt还是会报这个错

fanke123 avatar Feb 24 '23 09:02 fanke123

You tried to use BasicSR code to run the model. You need to use the code from this specific repository.

rlaphoenix avatar Mar 25 '23 08:03 rlaphoenix

同样的问题

chaishuhang avatar Apr 01 '23 11:04 chaishuhang

You tried to use BasicSR code to run the model. You need to use the code from this specific repository.

image I follow the installation from https://github.com/XPixelGroup/HAT#installation, and run the HAT/test.py, and then this bug appear. I cannot understand "use the code from this specific repository". How can I solve this problem? Thank you

1144181135 avatar May 08 '23 08:05 1144181135

This error occurs because there is a problem with the basicsr environment. The reason may be

  1. the hat environment is not installed correctly (python setup.py develop is not implemented), referring to https://github.com/XPixelGroup/HAT#installation.
  2. there are more than one basicsr existing in the current environment, and the wrong library is used.

chxy95 avatar May 08 '23 10:05 chxy95

Is it solved, please? I'm having the same issue too 请问解决了吗?我也遇到相同的问题了

xu1zhiyuan avatar Jun 25 '23 13:06 xu1zhiyuan

You tried to use BasicSR code to run the model. You need to use the code from this specific repository.

image I follow the installation from https://github.com/XPixelGroup/HAT#installation, and run the HAT/test.py, and then this bug appear. I cannot understand "use the code from this specific repository". How can I solve this problem? Thank you

https://blog.csdn.net/qq_41620742/article/details/129267462

xu1zhiyuan avatar Jun 25 '23 13:06 xu1zhiyuan

I'm having the same problem. When I run python setup.py develop, I get a long warning message like the one below at the beginning. @chxy95, do you think this is the root cause? II'm not sure if it helps, but I also attach the full messages on the terminal.

message-full.txt

depot/cfrueh/apps/env_hat/lib/python3.8/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
running develop
/depot/cfrueh/apps/env_hat/lib/python3.8/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/depot/cfrueh/apps/env_hat/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!

dkobayas-cyber avatar Sep 01 '23 17:09 dkobayas-cyber

I am not certain if the reported error is due to the installation order of Pytorch and BasicSR environment. Generally, in a clean conda environment, I would install Pytorch first, then execute the hat environment installation. I have never encountered the error reported. If you have encountered similar issues and are certain that the installation process is correct, you may refer to the following blog to see if it can be resolved.

You tried to use BasicSR code to run the model. You need to use the code from this specific repository.

image I follow the installation from https://github.com/XPixelGroup/HAT#installation, and run the HAT/test.py, and then this bug appear. I cannot understand "use the code from this specific repository". How can I solve this problem? Thank you

https://blog.csdn.net/qq_41620742/article/details/129267462

chxy95 avatar Sep 02 '23 09:09 chxy95

@chxy95 Thanks for the link. If I understand correctly, I need to change the lines:

import hat.arch
import hat.data
import hat.models

into

from hat.models import *

Is my understanding correct? I'm not sure in which file I need to make this modification. Do I need to do it only in train.py and test.py? Any other code in which I need to make this modification?

By the way, I printed the MODEL_REGISTRY variable by:

from basicsr.utils.registry import MODEL_REGISTRY
print(MODEL_REGITSTRY._obj_map) 

and it shows:

{'SRModel': basicsr.models.sr_model.SRModel,
 'VideoBaseModel': basicsr.models.video_base_model.VideoBaseModel,
 'VideoRecurrentModel': basicsr.models.video_recurrent_model.VideoRecurrentModel,
 'VideoRecurrentGANModel': basicsr.models.video_recurrent_gan_model.VideoRecurrentGANModel,
 'SRGANModel': basicsr.models.srgan_model.SRGANModel,
 'VideoGANModel': basicsr.models.video_gan_model.VideoGANModel,
 'SwinIRModel': basicsr.models.swinir_model.SwinIRModel,
 'EDVRModel': basicsr.models.edvr_model.EDVRModel,
 'StyleGAN2Model': basicsr.models.stylegan2_model.StyleGAN2Model,
 'HiFaceGANModel': basicsr.models.hifacegan_model.HiFaceGANModel,
 'ESRGANModel': basicsr.models.esrgan_model.ESRGANModel

It seems like some models are successfully registered but not the HATModel for some reason...

dkobayas-cyber avatar Sep 04 '23 00:09 dkobayas-cyber

@dkobayas-cyber The blog means to add the three modules to the system path.

chxy95 avatar Sep 04 '23 02:09 chxy95

@chxy95 I was misunderstanding something because of a mistranslation. The model works perfectly after the modifications. Thanks!

dkobayas-cyber avatar Sep 04 '23 15:09 dkobayas-cyber

我也遇到了同样的问题,这个该怎么解决呢?

iswangyifan avatar Apr 19 '25 18:04 iswangyifan