diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Converting safetensors file with "_pickle.UnpicklingError: invalid load key, ' '."

Open hoyAng96 opened this issue 1 year ago • 1 comments

Describe the bug

I'm trying to convert safetensors files on civitai to diffusers using the convert_original_stable_diffusion_to_diffusers.py script, and I'm getting <_pickle.UnpicklingError: invalid load key,> ' ' error, my pytorch version is 2.22 and cuda is 12.1. i have tried on both windows and liunx, but it's the same error.

Reproduction

python convert_original_stable_diffusion_to_diffusers.py --checkpoint realisticVisionV60B1_v51VAE.safetensors --dump-path for_diff

Logs

No response

System Info

  • diffusers version: 0.27.0.dev0
  • Platform: Windows-10-10.0.22621-SP0
  • Python version: 3.10.14
  • PyTorch version (GPU?): 2.2.2+cu121 (True)
  • Huggingface_hub version: 0.22.2
  • Transformers version: 4.39.3
  • Accelerate version: 0.29.3
  • xFormers version: not installed
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Who can help?

No response

hoyAng96 avatar Apr 26 '24 01:04 hoyAng96

Hi, you need to add the --from_safetensors arg.

asomoza avatar Apr 26 '24 07:04 asomoza