diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

conver sd_xl_base_1.0 to ONNXT model prompt error

Open mikeduoxin opened this issue 3 years ago • 3 comments

Describe the bug

i want to conver sd_xl_base_1.0 to ONNXT model use conv_sd_to_onnx.py but prompt error : global_step key not found in model Traceback (most recent call last): File "J:\download\StableDiffusionONNX\Stable-Diffusion-ONNX-FP16ver1.3\conv_sd_to_onnx.py", line 602, in pl = load_pipeline_from_original_stable_diffusion_ckpt( File "J:\download\StableDiffusionONNX\Stable-Diffusion-ONNX-FP16ver1.3\lib\site-packages\diffusers\pipelines\stable_diffusion\convert_from_ckpt.py", line 1141, in load_pipeline_from_original_stable_diffusion_ckpt unet.load_state_dict(converted_unet_checkpoint) File "J:\download\StableDiffusionONNX\Stable-Diffusion-ONNX-FP16ver1.3\lib\site-packages\torch\nn\modules\module.py", line 1667, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(

Reproduction

global_step key not found in model Traceback (most recent call last): File "J:\download\StableDiffusionONNX\Stable-Diffusion-ONNX-FP16ver1.3\conv_sd_to_onnx.py", line 602, in pl = load_pipeline_from_original_stable_diffusion_ckpt( File "J:\download\StableDiffusionONNX\Stable-Diffusion-ONNX-FP16ver1.3\lib\site-packages\diffusers\pipelines\stable_diffusion\convert_from_ckpt.py", line 1141, in load_pipeline_from_original_stable_diffusion_ckpt unet.load_state_dict(converted_unet_checkpoint) File "J:\download\StableDiffusionONNX\Stable-Diffusion-ONNX-FP16ver1.3\lib\site-packages\torch\nn\modules\module.py", line 1667, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(

Logs

No response

System Info

Diffusers version :sd_xl_base_1.0 platform: windows 11 Python version:3.10.6 use AMD 6800 VIDEO CARD

Who can help?

No response

mikeduoxin avatar Nov 21 '23 05:11 mikeduoxin

We recommend using optimum: https://github.com/huggingface/optimum for everything onnx related cc @echarlaix

patrickvonplaten avatar Nov 21 '23 14:11 patrickvonplaten

@mikeduoxin you can find more examples for export and inference in the documentation, and feel free to open an issue in optimum directly in case you're facing any issue.

Also might make sense to start adding deprecation warnings in diffusers @patrickvonplaten wdyt ?

echarlaix avatar Nov 22 '23 11:11 echarlaix

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Dec 26 '23 15:12 github-actions[bot]