pytorch-labs / segment-anything-fast

A batched offline inference oriented version of segment-anything
Apache License 2.0
1.21k stars 72 forks source link

Use weights_only for load #127

Closed kit1980 closed 2 months ago

kit1980 commented 3 months ago

torch.load without weights_only parameter is unsafe. Explicitly set weights_only to False only if you trust the data you load and full pickle functionality is needed, otherwise set weights_only=True.

If weights_only=True doesn't work for some cases, then explicit weights_only=False should be used.

Found with https://github.com/pytorch-labs/torchfix/