-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question with 'data_transform' #32
Comments
Whata the error? |
yes, I use the 3d_to_2d.py code to get data and run pytorch_run.py . the error is like : so I change the data_trandform definition for input label(because it is single channel, and can't be normalized with three channel setting), and the problem solved. sorry to disturbe you again, I really appreciate your nice work. Waiting for you reply. |
I did data transformation in a different jupyter file because I had to test different configurations. Are you facing any errors now? |
Hi, I am having the same problem. Namely that the data transform for the mask in line 295 uses the same transform as the 3 channel image data. s_label = data_transform(im_label) Could you let me know what was changed to get it to run in your case? |
Just to answer my own question - I added a new function for the binary mask transforms: data_transform_mask = torchvision.transforms.Compose([
torchvision.transforms.ToTensor(),
torchvision.transforms.Normalize(mean=[0.5], std=[0.5])]) and applied this to line 295: s_label = data_transform_mask(im_label) |
Done. |
Hi, I just change the data_transform function for label image with one channel definition (similar with what @c-arthurs did. but I am not sure if the change is reasonable because I am not sure whether do data transform for ground truth image will influent segmentation results . |
Hey @iWeisskohl , Do you have a link supporting this? |
Hi, I have some doubts with 'data_transform' function. As you suggested , input image should be 3 channel image and input label should be 1 channel image , but I find you use the same data_transform function
data_transform = torchvision.transforms.Compose([
# torchvision.transforms.Resize((128,128)),
# torchvision.transforms.CenterCrop(96),
torchvision.transforms.ToTensor(),
torchvision.transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])
])
for input image and input label during training. And use another function
data_transform = torchvision.transforms.Compose([
# torchvision.transforms.Resize((128,128)),
# torchvision.transforms.CenterCrop(96),
torchvision.transforms.Grayscale(),
#torchvision.transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5]) ])
for input image and input label for calculating the Dice Score.
and the codes output error with shape error with those functions when i run them . So I am wondering is there a misktake with the defination and using for data_transform function ?
Thanks in advance ! Have a nice day!
The text was updated successfully, but these errors were encountered: