wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
7.04k stars 1.78k forks source link

About the use of general-x4v3.pth model in Real-ESRGAN-0.3.0 #1573

Closed hu2220903 closed 2 months ago

hu2220903 commented 2 months ago

Env

About this repo

0.3.0 Real-ESRGAN

Your problem

The first time I used gen_wts.py, it showed an error like this:

  1. ModuleNotFoundError: No module named 'realesrgan.version'

    And then related statements are logged out in Real-ESRGAN-0.3.0\realesrgan_init_.py,error disappeared

2.After that, I reuse python gen_wts.py,it seemed to download two .pth files: realesr-general-x4v3.pth and realesr-general-wdn-x4v3.pth into the ../Real-ESRGAN-0.3.0/weights/

FileNotFoundError: [Errno 2] No such file or directory: 'weights\realesr-general-x4v3-cat.pth'

this may be from the 102rows in the file gen_wts.py,it shows that "model_path = model_path.replace('realesr-general-x4v3', 'realesr-general-x4v3-cat')", I dont know how can I find this -cat.pth file.

The whole error shows like :

Traceback (most recent call last): File "gen_wts.py", line 136, in main() File "gen_wts.py", line 106, in main upsampler = RealESRGANer( File "D:\BlogCode\Real-ESR-GAN-TEST2\Real-ESRGAN-0.3.0\realesrgan\utils.py", line 63, in init loadnet = torch.load(model_path, map_location=torch.device('cpu')) File "D:\Anaconda\envs\hospital\lib\site-packages\torch\serialization.py", line 771, in load with _open_file_like(f, 'rb') as opened_file: File "D:\Anaconda\envs\hospital\lib\site-packages\torch\serialization.py", line 270, in _open_file_like return _open_file(name_or_buffer, mode) File "D:\Anaconda\envs\hospital\lib\site-packages\torch\serialization.py", line 251, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'weights\realesr-general-x4v3-cat.pth'