LiveTalking icon indicating copy to clipboard operation
LiveTalking copied to clipboard

module 'torch' has no attribute 'float8_e4m3fn'

Open kkkwjr opened this issue 1 year ago • 3 comments

今天运行的时候环境突然崩了,有人知道怎么解决吗,万分感谢! For example: export FFMPEG_PATH=/musetalk/ffmpeg-4.4-amd64-static Traceback (most recent call last): File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/utils/import_utils.py", line 920, in _get_module return importlib.import_module("." + module_name, self.name) File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 992, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/models/autoencoders/init.py", line 1, in from .autoencoder_asym_kl import AsymmetricAutoencoderKL File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/models/autoencoders/autoencoder_asym_kl.py", line 22, in from ..modeling_utils import ModelMixin File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 35, in from ..quantizers import DiffusersAutoQuantizer, DiffusersQuantizer File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/quantizers/init.py", line 15, in from .auto import DiffusersAutoQuantizer File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/quantizers/auto.py", line 31, in from .torchao import TorchAoHfQuantizer File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/quantizers/torchao/init.py", line 15, in from .torchao_quantizer import TorchAoHfQuantizer File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/quantizers/torchao/torchao_quantizer.py", line 43, in torch.float8_e4m3fn, AttributeError: module 'torch' has no attribute 'float8_e4m3fn'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/workspace/kkkjr/Item/LiveTalking/app.py", line 744, in from musereal import MuseReal File "/workspace/kkkjr/Item/LiveTalking/musereal.py", line 21, in from musetalk.utils.utils import get_file_type,get_video_fps,datagen File "/workspace/kkkjr/Item/LiveTalking/musetalk/utils/utils.py", line 15, in from musetalk.models.vae import VAE File "/workspace/kkkjr/Item/LiveTalking/musetalk/models/vae.py", line 1, in from diffusers import AutoencoderKL File "", line 1075, in _handle_fromlist File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/utils/import_utils.py", line 911, in getattr value = getattr(module, name) File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/utils/import_utils.py", line 910, in getattr module = self._get_module(self._class_to_module[name]) File "/home/wpg/anaconda3/envs/livestream/lib/python3.10/site-packages/diffusers/utils/import_utils.py", line 922, in _get_module raise RuntimeError( RuntimeError: Failed to import diffusers.models.autoencoders.autoencoder_kl because of the following error (look up to see its traceback): module 'torch' has no attribute 'float8_e4m3fn'

kkkwjr avatar Dec 25 '24 02:12 kkkwjr

Traceback (most recent call last): File "/workspace/kkkjr/Item/LiveTalking/app.py", line 744, in from musereal import MuseReal File "/workspace/kkkjr/Item/LiveTalking/musereal.py", line 2, in import torch File "/home/wpg/anaconda3/envs/nerfstream/lib/python3.10/site-packages/torch/init.py", line 235, in from torch._C import * # noqa: F403 ImportError: libnvJitLink.so.12: cannot open shared object file: No such file or directory

先会出现这个错,然后降级了torch之后会出现module 'torch' has no attribute 'float8_e4m3fn'

kkkwjr avatar Dec 25 '24 03:12 kkkwjr

你好,解决了吗,我也出现了

shou-heng avatar Mar 19 '25 09:03 shou-heng

你好,解决了吗,我也出现了

我记得好像是重新搭了环境,并且我发现下面这种快的下载方式容易导致出问题 pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2
--index-url https://download.pytorch.org/whl/cu118
-i https://pypi.tuna.tsinghua.edu.cn/simple 后面老老实实用官方的指令下载就好啦: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

具体为啥出现这种问题还不太清楚,有可能是无意间改了配置? 可参考一下:https://github.com/huggingface/transformers/issues/32185 要是解决了说一下是啥方法解决的哈

kkkwjr avatar Mar 19 '25 09:03 kkkwjr