weights_only=True error

#4
by Dracones - opened

Getting the below on both dual and single nvidia 3090 systems using both Conda and Venv with Python 3.11:

Loading CLIP 📎Loading tokenizer 🪙Loading LLM 🤖Loading image adapter 🖼
Traceback (most recent call last):
  File "/home/mmealman/src/joy-caption-pre-alpha/app.py", line 179, in <module>
    main()
  File "/home/mmealman/src/joy-caption-pre-alpha/app.py", line 149, in main
    models = load_models()
             ^^^^^^^^^^^^^
  File "/home/mmealman/src/joy-caption-pre-alpha/app.py", line 49, in load_models
    image_adapter.load_state_dict(torch.load(CHECKPOINT_PATH / "image_adapter.pt", map_location="cpu", weights_only=True))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mmealman/src/joy-caption-pre-alpha/venv/lib/python3.11/site-packages/torch/serialization.py", line 1113, in load
    raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
 Please file an issue with the following so that we can make `weights_only=True` compatible with your use case: WeightsUnpickler error: Unsupported operand 118

Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.

I know it sounds silly but have you activated your venv? If you have you can try turning weights_only=False in the line that's mentioned. Try reinstalling all the requirements via pip3 install -r requirements.txt ensuring your venv is activated (just c+p the code in the readme). Edit: Try git clone again and refollow the instructions.

Try to manually download image_adapter.pt from this HF repo and put it in wpkklhc6.
I had the same issue, git clone only downloaded metadata of that file

Try to manually download image_adapter.pt from this HF repo and put it in wpkklhc6.
I had the same issue, git clone only downloaded metadata of that file

Thank you! I had the same error and that fixed it!

Thanks. This makes sense since I don't have git LFS installed and it'd work fine for people with that.

Dracones changed discussion status to closed

Sign up or log in to comment