zhengchen1999 / DAT

PyTorch code for our ICCV 2023 paper "Dual Aggregation Transformer for Image Super-Resolution"
Apache License 2.0
350 stars 27 forks source link

Name DAT is not found, use name: DAT_basicsr! #1

Open AIisCool opened 11 months ago

AIisCool commented 11 months ago
Name DAT is not found, use name: DAT_basicsr!
Traceback (most recent call last):
  File "C:\DAT-main\basicsr\test.py", line 44, in <module>
    test_pipeline(root_path)
  File "C:\DAT-main\basicsr\test.py", line 34, in test_pipeline
    model = build_model(opt)
  File "C:\Python310\lib\site-packages\basicsr\models\__init__.py", line 26, in build_model
    model = MODEL_REGISTRY.get(opt['model_type'])(opt)
  File "C:\Python310\lib\site-packages\basicsr\models\sr_model.py", line 22, in __init__
    self.net_g = build_network(opt['network_g'])
  File "C:\Python310\lib\site-packages\basicsr\archs\__init__.py", line 22, in build_network
    net = ARCH_REGISTRY.get(network_type)(**opt)
  File "C:\Python310\lib\site-packages\basicsr\utils\registry.py", line 71, in get
    raise KeyError(f"No object named '{name}' found in '{self._name}' registry!")
KeyError: "No object named 'DAT' found in 'arch' registry!"
zhengchen1999 commented 11 months ago

Hi. Thanks for your interest in our work. I think the reason for your error is that Dependencies are not prepared. This project needs to be installed locally. Perform the following steps in sequence on the terminal.

git clone https://github.com/zhengchen1999/DAT.git
cd DAT
conda create -n DAT python=3.8
conda activate DAT
pip install -r requirements.txt
python setup.py develop

After that, you can run the program normally. If you have any other problem, please let us know. Thanks.

Julesaiyy commented 11 months ago

Thank you very much for your wonderful work. May I ask why did I follow the prompts and still encounter the above situation? Looking forward to your reply.

Asubayo commented 11 months ago

I just tried it and got the same traceback logs. Even though it is specified in requirements.txt, I had to manually run conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=11.1 -c pytorch -c conda-forge

zhengchen1999 commented 11 months ago

Sorry for the late reply.

I think you didn't run the command python setup.py develop and set up environment successfully.

Can you provide the conda env after you run the command?

PS: In some GPU servers (most do not need), pytorch needs to be installed separately. For example in 3090 GPU server, the complete commands is

conda create -n DAT python=3.8
conda activate DAT
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio===0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install -r requirements.txt (delete torch==1.8.0 and torchvision in requirements.txt)
python setup.py develop

I run these commands locally, and can install the environment successfully without issue.

Julesaiyy commented 11 months ago

I am using an A5000 single GPU training and have followed the steps to achieve results. I am not sure what the problem is, but still cannot be solved?

zhengchen1999 commented 11 months ago

Is your pytorch installed successfully? (running other projects successfully). Can you provide the log after running the command python setup.py develop?

Julesaiyy commented 10 months ago

Is your pytorch installed successfully? (running other projects successfully). Can you provide the log after running the command python setup.py develop?

And I believe Python has been successfully installed, and other projects can also be used normally.

zhengchen1999 commented 10 months ago

Is your conda env newly built? Judging from the log, your setup is successful. There is a possibility that you have installed BasicSR before, which caused a conflict.

Julesaiyy commented 10 months ago

Is your conda env newly built? Judging from the log, your setup is successful. There is a possibility that you have installed BasicSR before, which caused a conflict.

According to your prompt, I have successfully resolved this issue. I hope future users will remember my painful lesson: never install basicsr on your own beforehand, as it will cause conflicts. Once again, I am grateful for the author's patient assistance and this impressive work.

Zhihao-chen-666 commented 9 months ago

python setup.py develop

Hello, may I ask you use one gpu A5000, How long does it take to train?

Zhihao-chen-666 commented 9 months ago

Hello, How long does it takes to train?

turbowenxuan commented 3 months ago

Sorry for the late reply.

I think you didn't run the command python setup.py develop and set up environment successfully.

Can you provide the conda env after you run the command?

PS: In some GPU servers (most do not need), pytorch needs to be installed separately. For example in 3090 GPU server, the complete commands is

conda create -n DAT python=3.8
conda activate DAT
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio===0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install -r requirements.txt (delete torch==1.8.0 and torchvision in requirements.txt)
python setup.py develop

I run these commands locally, and can install the environment successfully without issue.

Is this the same operation in the Linux system? I rented a server from the Internet to run this project. But the problem is No object named 'DAT' found in 'arch' registry!

zhengchen1999 commented 3 months ago

Linux operates like this. Your issue, still not successfully installed. It's recommended that you reinstall a new environment (executing python setup.py develop in the old environment might always fail).

zhengchen1999 commented 3 months ago

Hello, How long does it takes to train?

It can be seen from the log (in experiments file), there will be an estimated time corresponding to it.