Skip to content

Instantly share code, notes, and snippets.

@jcreinhold
Last active July 26, 2021 08:24
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jcreinhold/78943cdeca1c5fca4a5af5d066bd8a8d to your computer and use it in GitHub Desktop.
Save jcreinhold/78943cdeca1c5fca4a5af5d066bd8a8d to your computer and use it in GitHub Desktop.
3d resnet for nifti images in fastai
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zzz123xyz
Copy link

I don't know why I can successfully train the model, but I always run into GPU out of memory problem in this line.
res = learner.model.forward(test[None,None,...]).cpu().detach().numpy()
there should not be any problem. I can have finish train the model. I have 1080 ti, the model and data in the learner loaded in the GPU is 500m already. This line required another 900m to forward. Could you help me with this?

@jcreinhold
Copy link
Author

You probably have too many items on the GPU when you run the command. Try saving the trained model, exiting the jupyter notebook, reopening the notebook, and then reloading the model (with learner.load) right before running the problem line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment