-
Notifications
You must be signed in to change notification settings - Fork 61
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
Errors when trying to predict after training #180
Comments
Check that your image sizes in X and Y are divisible by 16. You can crop or pad if they're not. Basic solution: add following code before # crop XY to the nearest size divisible by 16
if signal.shape[2] % 16 != 0:
signal = signal[:,:,signal.shape[2]%16//2:0-signal.shape[2]%16//2,:]
target = target[:,:,target.shape[2]%16//2:0-target.shape[2]%16//2,:]
if signal.shape[3] % 16 != 0:
signal = signal[:,:,:,signal.shape[3]%16//2:0-signal.shape[3]%16//2]
target = target[:,:,:,target.shape[3]%16//2:0-target.shape[3]%16//2] |
What are the sizes of your images at training and at prediction? Fnet also requires the minimum of 32 slices in Z. |
We're using the images downloaded from download_and_train.py and cropping them in the x and y dimensions, so they do have at least 32 slices in Z. The model was trained on the original uncropped images and the size of the cropped images are 688x464. |
We successfully trained a model on an 11gb graphics card, but when trying to run predictions, we ran into a CUDA out of memory error.
We then tried cropping the images to try to fix this error. We tried predicting with the original model and a new model trained on the cropped images but ran into an error stating that the size of the two tensors in fnet_nn_3d_params.py line 75 don't match.
We printed the sizes of the two tensors and found that they are the same size at the point where the error occurs.
Do you have any advice on how to fix these issues?
The text was updated successfully, but these errors were encountered: