Open eddiebergman opened 1 week ago
Just the code snippet that specifies weight_only that will cause the above crash:
self.model = torch.load(
os.path.join(self.target_path, WEIGHTS_FINAL_NAME(version)),
map_location=self.device if self.device is not None else torch.device("cpu"),
weights_only=True,
)
@herilalaina is this fixable or would require retraining of our surrogate?
I would stick with weights_only=False
. It allows to store and load both the weights (tensors) and the model specification (see here) from a single checkpoint file. Otherwise, we would need to manually provide the model’s hyperparameters when loading.
Right now using ifbo, we get very many annoying errors relating to loading the model within
ifbo/surrogate.py::__init__.py
I tried setting this to
torch.load(..., weights_only=True)
, however i then get the following error. Is it possible to export a weight only model, seems it wasnt serialized as you would other models. Unfortunatly I do not have much experience with this so can not recommend the fix.