Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torch not compiled with CUDA enabled #182

Open
TanvirHafiz opened this issue Oct 24, 2024 · 20 comments
Open

Torch not compiled with CUDA enabled #182

TanvirHafiz opened this issue Oct 24, 2024 · 20 comments

Comments

@TanvirHafiz
Copy link

i get this torch not compiled! error

C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
torch.utils._pytree._register_pytree_node(
C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
torch.utils._pytree._register_pytree_node(
C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
torch.utils._pytree._register_pytree_node(
please download ffmpeg-static and export to FFMPEG_PATH.
For example: export FFMPEG_PATH=/musetalk/ffmpeg-4.4-amd64-static
Traceback (most recent call last):
File "webgui.py", line 70, in
vae = AutoencoderKL.from_pretrained(config.pretrained_vae_path).to("cuda", dtype=weight_dtype)
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\torch\nn\modules\module.py", line 1152, in to
return self._apply(convert)
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
module._apply(fn)
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
module._apply(fn)
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\torch\nn\modules\module.py", line 825, in apply
param_applied = fn(param)
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\torch\nn\modules\module.py", line 1150, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\torch\cuda_init
.py", line 293, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

@sugatasanshiro
Copy link

pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121

@TanvirHafiz
Copy link
Author

pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121

that worked, but now this

(echomimic) F:\EchoMimic>export FFMPEG_PATH=D:\Program Files\FFMPEG-Static
'export' is not recognized as an internal or external command,
operable program or batch file.

why is export not a command?

@nitinmukesh
Copy link

@TanvirHafiz
See if this helps
https://youtu.be/WtHdvSSQlWo?si=clx_ygq5TlxYOdye

Also some additional changes to get better results are explained here
https://youtu.be/iVy2bXPQNKY?si=Xm-NFcE4pGOOBvVH

@TanvirHafiz
Copy link
Author

@TanvirHafiz See if this helps https://youtu.be/WtHdvSSQlWo?si=clx_ygq5TlxYOdye

Also some additional changes to get better results are explained here https://youtu.be/iVy2bXPQNKY?si=Xm-NFcE4pGOOBvVH

did all the things in the video and yet my problems not over, i get this

(echomimic) F:\EchoMimic>python webgui.py --server_port=3000
Traceback (most recent call last):
File "webgui.py", line 15, in
from diffusers import AutoencoderKL, DDIMScheduler
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\diffusers_init_.py", line 5, in
from .utils import (
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\diffusers\utils_init_.py", line 38, in
from .dynamic_modules_utils import get_class_from_dynamic_module
File "C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\diffusers\utils\dynamic_modules_utils.py", line 28, in
from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (C:\Users\steam\AppData\Local\Programs\Miniconda3\envs\echomimic\lib\site-packages\huggingface_hub_init_.py)

looks like i still need to import diffusers. but i just imported like 63 gigabytes of stuff from huggingface!

@nitinmukesh
Copy link

nitinmukesh commented Oct 25, 2024

@TanvirHafiz
Can you try

  1. activate virtual environment
  2. python infer_audio2vid.py

instead of WebUI.

but i just imported like 63 gigabytes of stuff from huggingface!
Which is correct. I have shown in video and how to reduce it to 40 GB.

@TanvirHafiz
Copy link
Author

right now I am reinstalling it using venv nad python instead of conda, as i am much more familiar with that. lets see. also your pretrained folder is 28GB, my one was 63 GB. i think maybe more things were added later since your video is 3 months old

@TanvirHafiz
Copy link
Author

didnt work @nitinmukesh it si still looking for 2 diffusers. Here is the error

(venv) F:\EchoMimic>python -u infer_audio2vid.py
Traceback (most recent call last):
File "F:\EchoMimic\infer_audio2vid.py", line 21, in
from diffusers import AutoencoderKL, DDIMScheduler
File "F:\EchoMimic\venv\lib\site-packages\diffusers_init_.py", line 5, in
from .utils import (
File "F:\EchoMimic\venv\lib\site-packages\diffusers\utils_init_.py", line 38, in
from .dynamic_modules_utils import get_class_from_dynamic_module
File "F:\EchoMimic\venv\lib\site-packages\diffusers\utils\dynamic_modules_utils.py", line 28, in
from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (F:\EchoMimic\venv\lib\site-packages\huggingface_hub_init_.py)

@TanvirHafiz
Copy link
Author

solved it, it had the wrong huggingface hub version, needed to add

pip install huggingface_hub==0.23.2

@AHannanSaal
Copy link

solved it, it had the wrong huggingface hub version, needed to add

pip install huggingface_hub==0.23.2

I was having the same errors as you were facing and after installing hugginface_hub==0.23.2 I am having below errors. Did you do anything else?

Traceback (most recent call last):
File "infer_audio2vid.py", line 257, in
main()
File "infer_audio2vid.py", line 225, in main
video = pipe(
File "D:\pinokio\bin\miniconda\envs\echomimic\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "D:\Echomimic\EchoMimic\src\pipelines\pipeline_echo_mimic.py", line 395, in call
whisper_feature = self.audio_guider.audio2feat(audio_path)
File "D:\Echomimic\EchoMimic\src\models\whisper\audio2feature.py", line 100, in audio2feat
result = self.model.transcribe(audio_path)
File "D:\Echomimic\EchoMimic\src\models\whisper\whisper\transcribe.py", line 85, in transcribe
mel = log_mel_spectrogram(audio)
File "D:\Echomimic\EchoMimic\src\models\whisper\whisper\audio.py", line 111, in log_mel_spectrogram
audio = load_audio(audio)
File "D:\Echomimic\EchoMimic\src\models\whisper\whisper\audio.py", line 42, in load_audio
ffmpeg.input(file, threads=0)
File "D:\pinokio\bin\miniconda\envs\echomimic\lib\site-packages\ffmpeg_run.py", line 313, in run
process = run_async(
File "D:\pinokio\bin\miniconda\envs\echomimic\lib\site-packages\ffmpeg_run.py", line 284, in run_async
return subprocess.Popen(
File "D:\pinokio\bin\miniconda\envs\echomimic\lib\subprocess.py", line 858, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:\pinokio\bin\miniconda\envs\echomimic\lib\subprocess.py", line 1327, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

@nitinmukesh
Copy link

nitinmukesh commented Oct 25, 2024

now I am reinstalling it using venv nad python instead of conda, as i am much more familiar with that. lets see. also your pretrained folder is 28GB, my one was 63 GB. i think maybe more things were added later since your video is 3 months ol

So is it working now?

also your pretrained folder is 28GB, my one was 63 GB

Yes and how to reduce folder size and what to delete is explained in (it is optional)
https://youtu.be/WtHdvSSQlWo?si=clx_ygq5TlxYOdye

@nitinmukesh
Copy link

@AHannanSaal

You are using pinokio. I am not sure about that.

@AHannanSaal
Copy link

@AHannanSaal

You are using pinokio. I am not sure about that.

I am using miniconda but the path its showing is under Pinokio installation. When I ran command for path in miniconda prompt it showed below result
(base) C:\Users\a.hannan>where conda
D:\pinokio\bin\miniconda\Library\bin\conda.bat
D:\pinokio\bin\miniconda\Scripts\conda.exe
D:\pinokio\bin\miniconda\condabin\conda.bat

@TanvirHafiz
Copy link
Author

now I am reinstalling it using venv nad python instead of conda, as i am much more familiar with that. lets see. also your pretrained folder is 28GB, my one was 63 GB. i think maybe more things were added later since your video is 3 months ol

So is it working now?

also your pretrained folder is 28GB, my one was 63 GB

Yes and how to reduce folder size and what to delete is explained in (it is optional) https://youtu.be/WtHdvSSQlWo?si=clx_ygq5TlxYOdye

hey i didnt find any part where you say what to remove to reduce the size. you just show that your pretrained folder is 28GB whereas mine is 63 GB. can you give me the time stamp in the video where you discuss reducing the size?

@AHannanSaal
Copy link

AHannanSaal commented Oct 25, 2024

now I am reinstalling it using venv nad python instead of conda, as i am much more familiar with that. lets see. also your pretrained folder is 28GB, my one was 63 GB. i think maybe more things were added later since your video is 3 months ol

So is it working now?

also your pretrained folder is 28GB, my one was 63 GB

Yes and how to reduce folder size and what to delete is explained in (it is optional) https://youtu.be/WtHdvSSQlWo?si=clx_ygq5TlxYOdye

hey i didnt find any part where you say what to remove to reduce the size. you just show that your pretrained folder is 28GB whereas mine is 63 GB. can you give me the time stamp in the video where you discuss reducing the size?

it is in the other video uploaded 2,3 days ago. Basically it reduces size from 63Gb to around 45gb
https://youtu.be/iVy2bXPQNKY?t=304

@sugatasanshiro
Copy link

xdpJLXZSVu

@nitinmukesh
Copy link

nitinmukesh commented Oct 25, 2024

@TanvirHafiz
Here I mentioned on how to reduce size.
https://youtu.be/iVy2bXPQNKY?t=310

I think you guys are skipping the video and not watching it completely. I have explained the complete process in details.
I also updated the installation steps in original videos to fix new issues.

@sugatasanshiro
Copy link

@nitinmukesh - thank you

@TanvirHafiz
Copy link
Author

TanvirHafiz commented Oct 26, 2024 via email

@nitinmukesh
Copy link

@TanvirHafiz

#185

@AHannanSaal
Copy link

AHannanSaal commented Oct 28, 2024

Okay I got it. In fact not I'm stuck with opencv error. Where is cannot resize the image. Which version of open CV are you using?

On Sat, 26 Oct 2024, 8:15 am Sugata Sanshiro, @.> wrote: @nitinmukesh https://github.com/nitinmukesh - thank you — Reply to this email directly, view it on GitHub <#182 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3IB2HV2WAHEGJBSLYQ4PTTZ5L3MXAVCNFSM6AAAAABQQDX7S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZZGE4DAMRVGQ . You are receiving this because you were mentioned.Message ID: @.>

Were you able to fix it? I am also getting similar error
cv2.error: OpenCV(4.10.0) 👎 error: (-5:Bad argument) in function 'resize'

Overload resolution failed:

  • src is not a numerical tuple
  • Expected Ptrcv::UMat for argument 'src'

Edit:
I noticed I didnt have "opencv-python-headless" in the pip list so I installed using below command
pip install opencv-python-headless --user

Now I am getting below error

File "C:\Users\a.hannan.conda\envs\echomimic\lib\subprocess.py", line 1327, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants