FJDorfner commited on
Commit
5135078
·
verified ·
1 Parent(s): 2174707

Update Model_Class.py

Browse files

set torch.load(weights_only=False) to ensure compatibility with torch > 2.6.

Files changed (1) hide show
  1. Model_Class.py +1 -1
Model_Class.py CHANGED
@@ -59,7 +59,7 @@ val_transforms_416x628 = Compose(
59
  ]
60
  )
61
 
62
- checkpoint = torch.load("classification_model.ckpt", map_location=torch.device('cpu'))
63
  model = ResNet()
64
  model.load_state_dict(checkpoint["state_dict"])
65
  model.eval()
 
59
  ]
60
  )
61
 
62
+ checkpoint = torch.load("classification_model.ckpt", map_location=torch.device('cpu'), weights_only=False)
63
  model = ResNet()
64
  model.load_state_dict(checkpoint["state_dict"])
65
  model.eval()