cswry / SeeSR

[CVPR2024] SeeSR: Towards Semantics-Aware Real-World Image Super-Resolution
Apache License 2.0
331 stars 14 forks source link

Cant run Demo #17

Open MrSorSor opened 4 months ago

MrSorSor commented 4 months ago

hello i followed your instructions for installation however when i got to run python gradio_seesr.py i get the following:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.0.1+cu118 with CUDA 1108 (you have 2.0.1+cpu) Python 3.8.10 (you have 3.8.18) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details Traceback (most recent call last): File "gradio_seesr.py", line 19, in <module> from pipelines.pipeline_seesr import StableDiffusionControlNetPipeline File "E:\AI\SeeSR\pipelines\pipeline_seesr.py", line 25, in <module> from torchvision.utils import save_image ModuleNotFoundError: No module named 'torchvision'

i tried reinstalling xformers, install torchvision, upgrading pytorch, upgrading python to 3.8.18 and also to 3.10.11, also after doing some of the steps i mentioned, it starts to ask me to install missing modules and so i install them and i keep installing until i get to a point where it say torch.cuda.is_available() should be true but it is false and then i couldn't do anything after that. (of course all of this with the conda environment is active)

i have a 4080 desktop pc and i use other ai interfaces such as automatic1111 and comfyui without an issue.

i am using Miniconda3-latest

I appreciate all the help you can give to enable me to run the demo locally.

mashoutsider commented 4 months ago

I'm not involved in this project, but plan to try it soon.

I notice in the requirements.txt file it has torch==2.0.1 but torch comes with different flavours, including a minimal cuda library. If you look on the torch website here: https://pytorch.org/get-started/previous-versions/#linux-and-windows-7 you can see that to install torch2.0.1 with cu118 you need: pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118

notice the flag --index-url https://download.pytorch.org/whl/cu118

maybe that solves your problem?

MrSorSor commented 4 months ago

thank you for your suggestion, i tried that already but i tried it again just to make sure. after installing torch through the link you provided (i also tried using conda) it starts asking you to install missing modules. after 7 or 8 module installs you get to a point where this error is logged to the console:

ValueError: torch.cuda.is_available() should be True but is False. xformers' memory efficient attention is only available for GPU

at this point i got stuck and i have no idea what to do next. please if you have another suggestion it will be highly appreciated.

redrockvp commented 4 months ago

Give this a try, I'm running this in a conda environment set to python 3.11 :

pip install torch==2.1.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 xformers einops scipy timm

Note that einops, scipy and timm are not currently listed in the requirements.txt. I am also using a different version of torch and requesting a specific version of xformers. I am on Windows 11 so xformers and torch can be a bit tricky.

I am getting another error now, but not related to package installs or versions, just gotta figure out the model structure now :)

MrSorSor commented 4 months ago

thank you for the suggestion.

unfortunately it didn't work.

i erased the seesr env to start fresh and did the steps of the installing instructions with an exception that i changed this conda create -n seesr python=3.8 to conda create -n seesr python=3.11 (and before i deleted the env i tried the code you posted with python 3.8 as well)

then i entered your suggestion but when i did it gave me an error:

ERROR: Could not find a version that satisfies the requirement einops (from versions: none) ERROR: No matching distribution found for einops

this error was for einops, scipy and timm, so i removed them from the code you provided and i entered only pip install torch==2.1.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 xformers

then i installed einops, scipy and timm (using pip install).

after everything i tried running python gradio_seesr.py and i got the same error: ValueError: torch.cuda.is_available() should be True but is False. xformers' memory efficient attention is only available for GPU

everything i did was of course while i am in the directory of seesr and with the environment active.