Runtime error when Duplicating a Space

Already tried to manually set the version for torchvision and torch in requirements.txt to latest but still the same. I’m just curious why it’s giving me this error. Any help is greatly appreciated :smile_cat:

runtime error
Exit code: 1. Reason: Traceback (most recent call last):
File “/home/user/app/app.py”, line 6, in
from basicsr.archs.srvgg_arch import SRVGGNetCompact
File “/usr/local/lib/python3.10/site-packages/basicsr/init.py”, line 4, in
from .data import *
File “/usr/local/lib/python3.10/site-packages/basicsr/data/init.py”, line 22, in
_dataset_modules = [importlib.import_module(f’basicsr.data.{file_name}‘) for file_name in dataset_filenames]
File “/usr/local/lib/python3.10/site-packages/basicsr/data/init.py”, line 22, in
_dataset_modules = [importlib.import_module(f’basicsr.data.{file_name}’) for file_name in dataset_filenames]
File “/usr/local/lib/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “/usr/local/lib/python3.10/site-packages/basicsr/data/realesrgan_dataset.py”, line 11, in
from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
File “/usr/local/lib/python3.10/site-packages/basicsr/data/degradations.py”, line 8, in
from torchvision.transforms.functional_tensor import rgb_to_grayscale
ModuleNotFoundError: No module named ‘torchvision.transforms.functional_tensor’

1 Like

It seems that the basicsr library in pip is too old and is causing a problem. Possible workarounds include: fixing the torch and torchvision versions to an older version, or loosening the conditions. Using the github version of basicsr.
If you want to solve the problem, I think the only way is to fork the basicsr github and redo the settings for yourself.

git+https://github.com/XPixelGroup/BasicSR in requiements.txt
or
pip install git+https://github.com/XPixelGroup/BasicSR
1 Like

Yeah i don’t think i can mamage that in my current knowledge, but yeah i have found out that basicsr is causing these problems for some but when i try to edit requirements txt and set basicsr==1.3.5 the build process doesn’t proceed. Thanks for sharing your knowledge, i really appreciate it :handshake:t2:

1 Like

Try

git+https://github.com/XPixelGroup/BasicSR

or

new-basicsr

instead

basicsr==1.3.5

Well, a lot of people are having trouble with it. So there are a few workarounds. Someone made them.

Thanks for your help, unfortunately it still downloads the basicsr 1.4.2 upon checking the logs. I think it’s because Realesrgan and gfpgan depend on it.

I have made that duplicate space public if you wanna contribute changes to that Space and if fixes that issue. Just kinda curious and weird that it fails when it’s a duplicate of the working one. Thanks again :handshake:t2:

The service that was running had probably not been restarted for several years, and it was probably started because there were no problems with the latest libraries at the time.
I made quite a few changes and got it working. Try merge it. This is an antique…

1 Like

Amazing, you are so helpful. I checked it and yeah it works now. Thanks for sharing your info, this will definitely help me out in the future, thank you so much @John6666 :handshake:t2:

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.