Won't work
I just installed it in a WSL into windows 10.
I cloned the repo, installed all the requeriments in an venv for this project.
I created a file calle script.py with the code you provide in the Model Card info, copied my watermarked image to the root path of the project folder where all the files are and replaced the info into the script.
The output is this:
Traceback (most recent call last):
File "/home/wmremoval/script.py", line 13, in
model.load_state_dict(torch.load(model_path, map_location=device))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wmremoval/lib/python3.12/site-packages/torch/serialization.py", line 1494, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. In PyTorch 2.6, we changed the default value of the weights_only
argument in torch.load
from False
to True
. 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.