We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca7e02c commit 46e6a08Copy full SHA for 46e6a08
micro_sam/instance_segmentation.py
@@ -5,6 +5,7 @@
5
"""
6
7
import os
8
+import pickle
9
import warnings
10
from abc import ABC
11
from collections import OrderedDict
@@ -748,7 +749,12 @@ def load_instance_segmentation_with_decoder_from_checkpoint(
748
749
InstanceSegmentationWithDecoder
750
751
device = util.get_device(device)
- state = torch.load(checkpoint, map_location=device)
752
+
753
+ # over-ride the unpickler with our custom one
754
+ custom_pickle = pickle
755
+ custom_pickle.Unpickler = util._CustomUnpickler
756
757
+ state = torch.load(checkpoint, map_location=device, pickle_module=custom_pickle)
758
759
# Get the predictor.
760
model_state = state["model_state"]
0 commit comments