Skip to content

Commit

Permalink
Update SegmentationSegformer checkpoint loading with optional weights…
Browse files Browse the repository at this point in the history
… parameter
  • Loading branch information
valhassan committed Feb 6, 2025
1 parent 916c76e commit 49e8929
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ def export_model(self, checkpoint_path: str, export_path: str, datamodule: Light
map_location = "cuda"
if self.device.type == "cpu":
map_location = "cpu"
best_model = self.__class__.load_from_checkpoint(checkpoint_path, map_location=map_location)
best_model = self.__class__.load_from_checkpoint(checkpoint_path,
weights_from_checkpoint_path=None,
map_location=map_location)
best_model.eval()

scrpted_model = script_model(best_model.model, datamodule, self.num_classes, from_logits=True)
Expand Down

0 comments on commit 49e8929

Please sign in to comment.