Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ session = ort.InferenceSession(model_path)
|
|
| 23 |
# Define the inference function
|
| 24 |
def inference(sample_name):
|
| 25 |
sample_path = os.path.join(os.getcwd(),'samples', f'{sample_name}.pth')
|
| 26 |
-
sample = torch.load(sample_path)
|
| 27 |
age = sample['boneage'].item()
|
| 28 |
outputs = session.run(None, {"input": sample['path'].numpy()})
|
| 29 |
predicted_age = (outputs[0]*41.172)+127.329
|
|
|
|
| 23 |
# Define the inference function
|
| 24 |
def inference(sample_name):
|
| 25 |
sample_path = os.path.join(os.getcwd(),'samples', f'{sample_name}.pth')
|
| 26 |
+
sample = torch.load(sample_path, weights_only=False, map_location="cpu")
|
| 27 |
age = sample['boneage'].item()
|
| 28 |
outputs = session.run(None, {"input": sample['path'].numpy()})
|
| 29 |
predicted_age = (outputs[0]*41.172)+127.329
|