ShineChen1024 / MagicClothing

Official implementation of Magic Clothing: Controllable Garment-Driven Image Synthesis
Other
1.37k stars 139 forks source link

when I use cpu to run inference.py, it return errors: safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge #41

Open bin-x opened 6 months ago

bin-x commented 6 months ago

i use mac, can't use cuda, so I change device to "cpu", then I run inference.py, it return errors: safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge

$ python inference.py --cloth_path images/garment/00055_00.jpg --model_path images/model/01008_00.jpg

Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.
Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.
Pipelines loaded with `dtype=torch.float16` cannot run with `cpu` device. It is not recommended to move them to `cpu` as running them will fail. Please make sure to use an accelerator to run the pipeline in inference, due to the lack of support for`float16` operations on this device in PyTorch. Please, remove the `torch_dtype=torch.float16` argument, or use another device for inference.
Traceback (most recent call last):
  File "/Users/admin/py/MagicClothing/inference.py", line 38, in <module>
    full_net = ClothAdapter(pipe, args.model_path, device, args.enable_cloth_guidance)
  File "/Users/admin/py/MagicClothing/garment_adapter/garment_diffusion.py", line 28, in __init__
    with safe_open(ref_path, framework="pt", device="cpu") as f:
safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge
sunnytomy commented 6 months ago

model path should be the checkpoint path,not the dress model picture path

bin-x commented 6 months ago

model path should be the checkpoint path,not the dress model picture path

how can i get the checkpoint ?

i-amgeek commented 5 months ago

Download from huggingface - https://huggingface.co/ShineChen1024/MagicClothing/tree/main

spacewalk01 commented 5 months ago

Used following command and got the same error: python inference.py --cloth_path images/a0.jpg --model_path checkpoints/cloth_segm.pth