Last active
January 18, 2025 15:50
-
-
Save prerakmody/3dd65eae6e05e64d8a218999a42b47aa to your computer and use it in GitHub Desktop.
UV - fast Python package installer and resolver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
>> pip install uv # OR https://docs.astral.sh/uv/getting-started/installation/ | |
>> uv run -p 3.11 uv-monai-torchsummary.py | |
""" | |
# /// script | |
# requires-python = ">=3.11" | |
# dependencies = [ | |
# "monai==1.3.2", | |
# "torchsummary==1.5.1", | |
# ] | |
# /// | |
import monai # v1.3.2 | |
import torchsummary # v1.5.1 | |
model = monai.networks.nets.UNet(in_channels=2, out_channels=1, spatial_dims=3, channels=[16, 32, 64, 128], strides=[2, 2, 2], num_res_units=2) | |
torchsummary.summary(model.cuda(), (2, 144, 144, 144)) | |
print ('\n\n =========================== \n\n') | |
model = monai.networks.nets.UNet(in_channels=5, out_channels=1, spatial_dims=3, channels=[16, 32, 64, 128], strides=[2, 2, 2], num_res_units=2) | |
torchsummary.summary(model.cuda(), (5, 144, 144, 144)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment