C2W2_Assignment notebook - RuntimeError: No CUDA GPUs are available

I got error “RuntimeError: No CUDA GPUs are available” in C2W2_Assignment notebook. I’ve tried to restart the lab 2 times but still got the same error.

What can I do?
Thanks,

Are you sure that your code is not hard-coding the device at some point? Note that the template code is designed to be flexible, so that they can run the training on the GPU, but the grader can use the CPU to save $$$.

The template code is hard coded with using GPU:
z_dim = 64
batch_size = 128
device = ‘cuda’
I don’t want to change it to not affect the grader.

Right, the point is that sometimes the value passed for the variable device is cuda and sometimes it may not be. I am away from my computer right now, so I cannt look at the assignment to refresh my memory or try running it to see if there is an environment problem on the servers.

I’ve just relaunched the lab and rerun all (after verifying the assignment works on my Mac M1 laptop with device = ‘mps’) and got no problem now. I got a Pass from the grader. Thanks.

1 Like