Skip to content

Commit

Permalink
Update GANDLF/models/brain_age.py
Browse files Browse the repository at this point in the history
Co-authored-by: Sarthak Pati <[email protected]>
  • Loading branch information
1Pravi and sarthakpati authored Aug 7, 2023
1 parent 318fc7f commit f189e7b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions GANDLF/models/brain_age.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ def brainage(parameters):
try:
# Load the pretrained VGG16 model
model = torchvision.models.vgg16(pretrained=True)
except Exception as e:
print("Error: Failed to load VGG16 model:", str(e))
sys.exit(1)
except Exception:
sys.exit("Error: Failed to load VGG16 model: " + traceback.format_exc())

# Remove the final convolutional layer
model.final_convolution_layer = None
Expand Down

0 comments on commit f189e7b

Please sign in to comment.