Image Segmentation: RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED

Did you try running the notebook without the GPU enabled to see what the actual error is?

I think this is normal behaviour when the GPU is enabled and you have created the DataLoaders.

I only guessed the codes weren’t working because when I removed them nothing changed.

When you run the notebook without the GPU enabled, you will see the error suggests that the target value is out of range. This is because the predictions output is a 1D tensor of length 7, but you have not told fastai what each value in that tensor actually represents (ie. there’s no mapping of target pixel value 105 to the codes array you provided). If you’re unsure what the model actually outputs when troubleshooting, you can quickly see by running the following after the learner is created:

with torch.no_grad():
    learn.eval()
    out = learn.model(xb)
out

Take a look at this notebook by Zach Mueller (not tagging him as I dont want to spam :). Although this is a binary segmentation, you can see how he converted the pixel values from the mask to something fastai can make sense of. You can take the same approach for your problem.

Don’t worry about one-hot encoding for now. Upon further research, it is not needed if you get this setup correct (as evidenced by Zach’s notebook)

2 Likes