lee-zq / 3DUNet-Pytorch

3DUNet implemented with pytorch
484 stars 108 forks source link

TypeError: Caught TypeError in DataLoader worker process 0. #4

Open wxr521314 opened 4 years ago

wxr521314 commented 4 years ago

Hi lee-zp Thanks for sharing your code.When I was training my own data, I had the following problem.My data is the data of MRI rectum, and I want to see the dice of tumor.

image

I tried some online methods, but nothing worked.Can you help me ? Best wish

lee-zq commented 4 years ago

In line 33 of the file ./utils/common.py: “ if random_x_max < 0 or random_y_max < 0 or random_z_max < 0: return None”. That means when crop size is larger than the image size, the func will return None. One unpack to two variable will cause TypeError: cannot unpack non-iterable NoneType object Please check your data's shape, ensure that the image is read correctly. (I will modify the code to throw the suitable error message )