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

Missing diffusion_pytorch_model.bin File in Pretrained Weights Directory #85

Open
unsiao opened this issue Dec 7, 2024 · 0 comments
Open
Labels
dependencies Pull requests that update a dependency file done tutorial

Comments

@unsiao
Copy link

unsiao commented Dec 7, 2024

Description:

I encountered an error when trying to load a pretrained model using the UNet2DConditionModel.from_pretrained method. The error message indicates that the diffusion_pytorch_model.bin file is not found in the specified directory.

Error Message:

OSError: Error no file named diffusion_pytorch_model.bin found in directory ./pretrained_weights/sd-image-variations-diffusers.

Directory Structure:

(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights/sd-image-variations-diffusers# ls
README.md            earring.jpg        inputs.jpg        scheduler       v2-montage.jpg
alias-montage.jpg    feature_extractor  model_index.json  unet            vae
default-montage.jpg  image_encoder      safety_checker    v1-montage.jpg
(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights/sd-image-variations-diffusers# cd ../
(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights# ls
README.md        configuration.json  motion_module.pth  reference_unet.pth             sd-vae-ft-mse
audio_processor  denoising_unet.pth  pose_encoder.pth   sd-image-variations-diffusers
(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights# ls -l
total 5805204
-rw-r--r-- 1 root root      12049 Dec  5 12:10 README.md
drwxr-xr-x 2 root root       4096 Dec  5 12:24 audio_processor
-rw-r--r-- 1 root root         50 Dec  5 12:10 configuration.json
-rw-r--r-- 1 root root 1702192597 Dec  5 12:16 denoising_unet.pth
-rw-r--r-- 1 root root  908951917 Dec  5 12:13 motion_module.pth
-rw-r--r-- 1 root root 1702048079 Dec  5 12:18 pose_encoder.pth
-rw-r--r-- 1 root root 1631280213 Dec  5 12:16 reference_unet.pth
drwxr-xr-x 9 root root       4096 Dec  5 12:22 sd-image-variations-diffusers
drwxr-xr-x 3 root root       4096 Dec  5 12:21 sd-vae-ft-mse
(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights# ls sd-image-variations-diffusers/vae/
config.json  diffusion_pytorch_model.bin

Steps to Reproduce:

  1. Run the script app.py.
  2. Observe the error message indicating the missing diffusion_pytorch_model.bin file.

Expected Behavior:
The script should successfully load the pretrained model without any errors.

Actual Behavior:
The script fails to load the pretrained model and raises an OSError indicating that the diffusion_pytorch_model.bin file is not found.

Possible Solution:
Update the path in the code to point to the correct directory where the diffusion_pytorch_model.bin file is located. For example:

reference_unet = UNet2DConditionModel.from_pretrained("./pretrained_weights/sd-image-variations-diffusers/vae", subfolder="unet", use_safetensors=False).to(dtype=dtype, device=device)

Additional Information:

  • Python Version: 3.10
  • Operating System: Ubuntu20.04

描述:

在尝试使用 UNet2DConditionModel.from_pretrained 方法加载预训练模型时,遇到了错误。错误信息表明在指定的目录中找不到 diffusion_pytorch_model.bin 文件。

错误信息:

OSError: Error no file named diffusion_pytorch_model.bin found in directory ./pretrained_weights/sd-image-variations-diffusers.

目录结构:

(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights/sd-image-variations-diffusers# ls
README.md            earring.jpg        inputs.jpg        scheduler       v2-montage.jpg
alias-montage.jpg    feature_extractor  model_index.json  unet            vae
default-montage.jpg  image_encoder      safety_checker    v1-montage.jpg
(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights/sd-image-variations-diffusers# cd ../
(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights# ls
README.md        configuration.json  motion_module.pth  reference_unet.pth             sd-vae-ft-mse
audio_processor  denoising_unet.pth  pose_encoder.pth   sd-image-variations-diffusers
(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights# ls -l
total 5805204
-rw-r--r-- 1 root root      12049 Dec  5 12:10 README.md
drwxr-xr-x 2 root root       4096 Dec  5 12:24 audio_processor
-rw-r--r-- 1 root root         50 Dec  5 12:10 configuration.json
-rw-r--r-- 1 root root 1702192597 Dec  5 12:16 denoising_unet.pth
-rw-r--r-- 1 root root  908951917 Dec  5 12:13 motion_module.pth
-rw-r--r-- 1 root root 1702048079 Dec  5 12:18 pose_encoder.pth
-rw-r--r-- 1 root root 1631280213 Dec  5 12:16 reference_unet.pth
drwxr-xr-x 9 root root       4096 Dec  5 12:22 sd-image-variations-diffusers
drwxr-xr-x 3 root root       4096 Dec  5 12:21 sd-vae-ft-mse
(base) root@VM-3-148-ubuntu:/workspace/echomimic_v2/pretrained_weights# ls sd-image-variations-diffusers/vae/
config.json  diffusion_pytorch_model.bin

重现步骤:

  1. 运行脚本 app.py
  2. 观察错误信息,指出缺少 diffusion_pytorch_model.bin 文件。

预期行为:
脚本应成功加载预训练模型,不出现任何错误。

实际行为:
脚本无法加载预训练模型,并引发 OSError,指出找不到 diffusion_pytorch_model.bin 文件。

可能的解决方案:
更新代码中的路径,指向包含 diffusion_pytorch_model.bin 文件的正确目录。例如:

reference_unet = UNet2DConditionModel.from_pretrained("./pretrained_weights/sd-image-variations-diffusers/vae", subfolder="unet", use_safetensors=False).to(dtype=dtype, device=device)

附加信息:

  • Python 版本: 3.10
  • 操作系统: Ubuntu20.04LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file done tutorial
Projects
None yet
Development

No branches or pull requests

2 participants