antgroup / echomimic

EchoMimic: Lifelike Audio-Driven Portrait Animations through Editable Landmark Conditioning
https://antgroup.github.io/ai/echomimic/
Apache License 2.0
3.01k stars 349 forks source link

Torch not compiled with CUDA enabled #182

Open TanvirHafiz opened 1 month ago

TanvirHafiz commented 1 month ago

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 commented 4 weeks ago

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

TanvirHafiz commented 4 weeks ago

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 commented 4 weeks ago

@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 commented 4 weeks ago

@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 commented 4 weeks ago

@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 commented 4 weeks ago

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 commented 4 weeks ago

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 commented 4 weeks ago

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

pip install huggingface_hub==0.23.2

AHannanSaal commented 4 weeks ago

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 commented 4 weeks ago

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 commented 4 weeks ago

@AHannanSaal

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

AHannanSaal commented 4 weeks ago

@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 commented 4 weeks ago

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 commented 4 weeks ago

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 commented 4 weeks ago

xdpJLXZSVu

nitinmukesh commented 4 weeks ago

@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 commented 4 weeks ago

@nitinmukesh - thank you

TanvirHafiz commented 3 weeks ago

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 https://github.com/BadToBest/EchoMimic/issues/182#issuecomment-2439180254, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3IB2HV2WAHEGJBSLYQ4PTTZ5L3MXAVCNFSM6AAAAABQQDX7S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZZGE4DAMRVGQ . You are receiving this because you were mentioned.Message ID: @.***>

nitinmukesh commented 3 weeks ago

@TanvirHafiz

https://github.com/BadToBest/EchoMimic/issues/185

AHannanSaal commented 3 weeks ago

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) :-1: error: (-5:Bad argument) in function 'resize'

Overload resolution failed:

  • src is not a numerical tuple
  • Expected Ptr 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