3D-UNet-PyTorch-Implementation icon indicating copy to clipboard operation
3D-UNet-PyTorch-Implementation copied to clipboard

how to run functions

Open Palashio opened this issue 3 years ago • 3 comments

so i've got a set of 3D images (128, 128, 128) (both images and their appropriate masks). I want to run this implementation of UNet on it. How would I do this? They're .nii files so i've coded up my on dataset loader for it. I'm a bit confused on where to get started as there aren't enough reference resources.

Palashio avatar Jul 30 '20 23:07 Palashio

I have it working so that this is what my training script looks like so far:

    for epoch in range(epochs):
        print(' - training - ')
        for i, (images, masks) in enumerate(train_loader):
            images = images.to(device)
            masks = masks.to(device)

where images, masks are both sizes (1, 1, 128, 128, 128) and train_loader looks like this:

train_loader = DataLoader(dataset=Dataset(partition['orig'], partition['segment']), 
                          batch_size = batch_size, shuffle = True)

where partition['orig] is the original image and partition['segment'] is the segmented image. the batch size is also 1.

Palashio avatar Jul 30 '20 23:07 Palashio

i will update info this weekend so that you can run the code successfully. Its been busy since i joined the job. sorry for causing inconvenience.

best regards,

Jielong

Thanks & regards, Jielong a Hong


From: Palash Shah [email protected] Sent: Friday, July 31, 2020 7:59:37 AM To: JielongZ/3D-UNet-PyTorch-Implementation [email protected] Cc: Subscribed [email protected] Subject: Re: [JielongZ/3D-UNet-PyTorch-Implementation] how to run functions (#3)

I have it working so that this is what my training script looks like so far:

for epoch in range(epochs):
    print(' - training - ')
    for i, (images, masks) in enumerate(train_loader):
        images = images.to(device)
        masks = masks.to(device)

where images, masks are both sizes (1, 1, 128, 128, 128) and train_loader looks like this:

train_loader = DataLoader(dataset=Dataset(partition['orig'], partition['segment']), batch_size = batch_size, shuffle = True)

where partition['orig] is the original image and partition['segment'] is the segmented image. the batch size is also 1.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/JielongZ/3D-UNet-PyTorch-Implementation/issues/3#issuecomment-666795295, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHCSY2UD4D7WLGFPN2NOXT3R6ICOTANCNFSM4PO5VNJA.

zyl200846 avatar Jul 31 '20 08:07 zyl200846