Several students have encountered this error from the grader on the Your First GAN Assignment (C1 W1):
Cell #14. Can’t compile the student’s code. Error: AssertionError(’\nFound no NVIDIA driver on your system. Please check that you\nhave an NVIDIA GPU and installed a driver from\nhttp://www.nvidia.com/Download/index.aspx’,)
First a little background: the course here is set up to provide virtual machines with access to Nvidia GPUs and “CUDA” support when we run the training in the course notebooks. The course staff went to significant trouble to get approval for this and it was necessary because the training here is so expensive that it is just too slow to be useful when you run it on a VM with only cpu as opposed to gpu to power the training. But it turns out that it costs more to get GPU enabled VMs, so they don’t use those when the grader is run. What that means is that they needed to figure out a way to make the code work in either cpu or gpu (“cuda”) mode. That’s why the device is a parameter to most of the functions here. Then in the code block that defines the set up for the training, you see these lines of template code given to you:
# Set your parameters
criterion = nn.BCEWithLogitsLoss()
n_epochs = 200
z_dim = 64
display_step = 500
batch_size = 128
lr = 0.00001
# Load MNIST dataset as tensors
dataloader = DataLoader(
MNIST('.', download=False, transform=transforms.ToTensor()),
batch_size=batch_size,
shuffle=True)
### DO NOT EDIT ###
device = 'cuda'
That last line is the critical difference that causes the training to run on the GPU when we run it locally. But then when you click “Submit Assignment” to invoke the grader, they need to disable that line. What they do is perform a preprocessing step that uses a “regular expression” to remove that line of code that sets the device. But it turns out that the RE they use is very specific. If you edit that line in any way, the regular expression does not match and the line is not removed, which causes the grader run to fail because it does not have access to the GPU. For example, removing the spaces like this will cause that error:
device='cuda'
Or replacing the single quotes with double quotes like this:
device = "cuda"
will also cause this failure. There should be no need for you to modify that line of code and they recently added that comment to tell you not to change it.
The bottom line: they are not kidding when they say “DO NOT EDIT” that line.
8 Likes
I am still unable to resolve this error. The deadline is approaching (22nd November) and I am unable to complete the course due to this error only. Will anybody please provide the original file without adding any code (designated as the student’s task)? Following the suggestion by paulinpaloalto if I will paste the exact same block (block which is defining the training parameter), I may get grade and complete my course specialization.
The instructions on the DLS FAQ Thread for getting a clean copy of a notebook work for GANs as well.
Also don’t sweat the deadlines: there is no penalty for missing them and they just automatically reset. But if you mean that you’ll owe another month worth of the subscription, then that’s a different matter. 
Thanks, it worked. Though, it worked with the private window.
Yeah, it doesn’t surprise me that you would need to account for cloud GPU cost. It’s nice because you can bring them up and down as needed rather than just completely pay for the cost if you owned the hardware. The downside is needing to programatically detect if their available or not which isn’t too hard in its down right. Just gotta take the ole infrastructure as code approach.
Hello, I have also the same kind of error for grading my assignment but for week4 : C1W4A_Build_a_Conditional_GAN.
I refreshed totally the file to be sure that I changed only the code between the right lines… but I still have the same grading error… On the other hand I the result of the calculation is quite nice!!!
Many thanks for your help
Philippe
If you’re sure you didn’t modify this line:
Then perhaps you’re getting the same problem discussed on this thread. There have been some problems recently with the Coursera environment getting updated or something that causes errors. Do your grader messages look similar to the ones shown on that other thread?
I checked and rechecked the line of the device definition (but I don’t have the ### DO NOT EDIT ### before)…
Ah, ok, I checked the C1W4A assignment and the code is different there: the “device” line is the same, but there is no “DO NOT EDIT” comment. So if you’re sure it looks the same, that’s probably not the problem. Well, have you tried getting a clean copy of the notebook and “copy/pasting” over just your completed code? That’s a bit of a pain, but that would make sure this is not the issue. There is a topic about how to do that on the DLS FAQ Thread.
But before going through that hassle, please “copy/paste” the actual exception message you are getting from the grader. That might give a better clue on whether this is the new problem mentioned on the thread I linked above or the old problem described on this current thread.
The error code from the grader is this one :
Cell #UNQ_C4. Can’t compile the student’s code. Error: AssertionError(‘\nFound no NVIDIA driver on your system. Please check that you\nhave an NVIDIA GPU and installed a driver from\nOfficial Drivers | NVIDIA’,)
Looks the same as for C1W1… I have made a new trial with a clean copy and I’ve got the same error…