ShineChen1024/MagicClothing

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

Opened this issue · 4 comments

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

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

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

how can i get the checkpoint ?

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