AniPortrait icon indicating copy to clipboard operation
AniPortrait copied to clipboard

执行命令报错

Open jacksonEE opened this issue 1 year ago • 1 comments

python -m scripts.pose2vid --config ./configs/prompts/animation.yaml -W 512 -H 512

Traceback (most recent call last): File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 109, in load_state_dict return torch.load(checkpoint_file, map_location="cpu") File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/site-packages/torch/serialization.py", line 797, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/site-packages/torch/serialization.py", line 283, in init super().init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 115, in load_state_dict if f.read().startswith("version"): File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 64: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/project/AniPortrait/scripts/pose2vid.py", line 200, in main() File "/project/AniPortrait/scripts/pose2vid.py", line 60, in main reference_unet = UNet2DConditionModel.from_pretrained( File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 800, in from_pretrained state_dict = load_state_dict(model_file, variant=variant) File "/data/pyenv-2.3.27/versions/3.10.12/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 127, in load_state_dict raise OSError( OSError: Unable to load weights from checkpoint file for './pretrained_model/stable-diffusion-v1-5/unet/diffusion_pytorch_model.bin' at './pretrained_model/stable-diffusion-v1-5/unet/diffusion_pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

jacksonEE avatar Apr 01 '24 09:04 jacksonEE

可能是pytorch版本不兼容,或者模型损坏。可尝试检查环境配置,或者重新下载模型。

Zejun-Yang avatar Apr 02 '24 08:04 Zejun-Yang