nateraw / stable-diffusion-videos

Create 🔥 videos with Stable Diffusion by exploring the latent space and morphing between text prompts
Apache License 2.0
4.4k stars 420 forks source link

Torch not complied with CUDA enabled #10

Closed PandaBalls closed 2 years ago

PandaBalls commented 2 years ago

from stable_diffusion_videos import interface ftfy or spacy is not installed using BERT BasicTokenizer instead of ftfy. Traceback (most recent call last): File "", line 1, in File "", line 1055, in _handle_fromlist File "D:\AI\stable-diffusion-videos\stable_diffusion_videos__init.py", line 75, in getattr__ submod = importlib.import_module(submod_path) File "D:\Conda_Envs\envs\SDV\lib\importlib__init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "D:\AI\stable-diffusion-videos\stable_diffusion_videos\app.py", line 6, in from .stable_diffusion_walk import SCHEDULERS, pipeline, walk File "D:\AI\stable-diffusion-videos\stable_diffusion_videos\stable_diffusion_walk.py", line 11, in pipeline = StableDiffusionPipeline.from_pretrained( File "D:\Conda_Envs\envs\SDV\lib\site-packages\diffusers\pipeline_utils.py", line 126, in to module.to(torch_device) File "D:\Conda_Envs\envs\SDV\lib\site-packages\torch\nn\modules\module.py", line 927, in to return self._apply(convert) File "D:\Conda_Envs\envs\SDV\lib\site-packages\torch\nn\modules\module.py", line 579, in _apply module._apply(fn) File "D:\Conda_Envs\envs\SDV\lib\site-packages\torch\nn\modules\module.py", line 579, in _apply module._apply(fn) File "D:\Conda_Envs\envs\SDV\lib\site-packages\torch\nn\modules\module.py", line 579, in _apply module._apply(fn) [Previous line repeated 1 more time] File "D:\Conda_Envs\envs\SDV\lib\site-packages\torch\nn\modules\module.py", line 602, in _apply param_applied = fn(param) File "D:\Conda_Envs\envs\SDV\lib\site-packages\torch\nn\modules\module.py", line 925, in convert return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) File "D:\Conda_Envs\envs\SDV\lib\site-packages\torch\cuda\init__.py", line 211, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

nateraw commented 2 years ago

Looks like you're using conda for your env. I expect this prints false for you:

import torch
print(torch.cuda.is_available())

If that's the case, you probably have a bad torch/cudatoolkit installation. In your conda env, run this:

conda install pytorch cudatoolkit=11.3 -c pytorch -y

This is assuming your cuda version is 11.3.

Then try again. I had to do the same on a new cloud machine last night, and after running the above, everything worked just fine.

ktronfabi commented 1 year ago

hi, i'm having the same problem but i couldn't make it work with the solution you suggested (im using the VSCode notebook), i tried to run "conda install pytorch cudatoolkit=11.3 -c pytorch -y" in the terminal but it does not recognize the "conda" command, btw anaconda is the selected kernel in my notebook

i tried running the install in a powershell outside vscode and it worked but in the notebook it keeps saying "Torch not complied with CUDA enabled"

if im understanding correctly its because its a different enviroment but anyway i wanted to clear that

maybe this is a newbie error and i apologize for that

i tried not using anaconda and selecting python for the kernel but it keeps waiting for "the jupyter session to be inactive"