SadTalker icon indicating copy to clipboard operation
SadTalker copied to clipboard

ModuleNotFoundError: No module named 'ai'

Open cloudbeer opened this issue 1 year ago • 3 comments

这个报错大概是什么原因? pip install ai 了也不对。

./checkpoints/epoch_20.pth Traceback (most recent call last): File "inference.py", line 158, in main(args) File "inference.py", line 55, in main preprocess_model = CropAndExtract(path_of_lm_croper, path_of_net_recon_model, dir_of_BFM_fitting, device) File "/home/cloudbeer/ai/SadTalker/src/utils/preprocess.py", line 53, in init checkpoint = torch.load(path_of_net_recon_model, map_location=torch.device(device))
File "/home/cloudbeer/anaconda3/envs/sadtalker/lib/python3.8/site-packages/torch/serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/home/cloudbeer/anaconda3/envs/sadtalker/lib/python3.8/site-packages/torch/serialization.py", line 930, in _legacy_load result = unpickler.load() File "/home/cloudbeer/anaconda3/envs/sadtalker/lib/python3.8/site-packages/torch/serialization.py", line 746, in find_class return super().find_class(mod_name, name) ModuleNotFoundError: No module named 'ai'

cloudbeer avatar Apr 15 '23 02:04 cloudbeer

pytorch的版本是什么呢?

vinthony avatar Apr 15 '23 02:04 vinthony

pytorch 按照文档来安装的。

Python 3.8.16 (default, Mar  2 2023, 03:21:46) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.12.1+cu113
nvidia-smi
Sat Apr 15 12:50:40 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.105.17   Driver Version: 525.105.17   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  Off |
|  0%   40C    P8    22W / 450W |   1860MiB / 24564MiB |      5%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1166      G   /usr/lib/xorg/Xorg                915MiB |
|    0   N/A  N/A      1570      G   /usr/bin/gnome-shell              279MiB |
|    0   N/A  N/A      4174      G   ...RendererForSitePerProcess      166MiB |
|    0   N/A  N/A      6158      G   ...323091750254540456,131072      331MiB |
|    0   N/A  N/A      7376      G   ...9/usr/lib/firefox/firefox      164MiB |
+-----------------------------------------------------------------------------+

nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

cloudbeer avatar Apr 15 '23 04:04 cloudbeer

pytorch 按照文档来安装的。

Python 3.8.16 (default, Mar  2 2023, 03:21:46) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.12.1+cu113
nvidia-smi
Sat Apr 15 12:50:40 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.105.17   Driver Version: 525.105.17   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  Off |
|  0%   40C    P8    22W / 450W |   1860MiB / 24564MiB |      5%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1166      G   /usr/lib/xorg/Xorg                915MiB |
|    0   N/A  N/A      1570      G   /usr/bin/gnome-shell              279MiB |
|    0   N/A  N/A      4174      G   ...RendererForSitePerProcess      166MiB |
|    0   N/A  N/A      6158      G   ...323091750254540456,131072      331MiB |
|    0   N/A  N/A      7376      G   ...9/usr/lib/firefox/firefox      164MiB |
+-----------------------------------------------------------------------------+
nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

可以检查下你的sadtalker的目录结构和github上的是否一致以及epoch_20这个模型是否完全下载成功?刚查了下我自己可以正常运行的sadtalker的环境,里面没有用到ai这个包,也没听说过有这个python包,这个ai像是你安装的sadtalker文件夹的上一级目录。

Winfredy avatar Apr 15 '23 11:04 Winfredy

真的是 epoch_20 这个包大小不对!已经成功生产出视频了。很棒。感谢!

cloudbeer avatar Apr 15 '23 16:04 cloudbeer