Lesson 8: Collaborative Filtering RuntimeError: CUDA error: device-side assert triggered

I have been working through the notebook and this error has kept me awake.
RuntimeError: CUDA error: device-side assert triggered. I first tried to find the activations, inputs and outputs of the model (using learn.model-to check if the layers’ shapes corresponded to each other) and it worked fine (as was recommended in the fastai course). However, I’ve not been able to find any good resolution online

Here is the code (in Github).

I get the error after trying to implement the CollabNN module in both the collab_learner and my own instance of the class. In the meantime I decided to perform principal component analysis on the DotProductBias model (as well as the collab_learner version of this as they were the only ones giving results). Before I bless myself with another error, would cycling through the embeddings (and latent factors) in a string comprehension work? I was planning to plot pairs of pcs together and test my EDA and matplotlib skills this way.

Hi Priestly,

Please search these forums for “device-side assert triggered” to find debugging tips.


I tried running your notebook without GPU, and it executed without any errors.

But why does it run without error on the CPU? Is it because the tensors are loaded there in different sizes and stuff? Would this not be problematic if I had a lot more data?

someone advised on the forums that if you get this kind of error, try running it without GPU, then the actual bug shows up. But in this case it runs alright on CPU, so I guess it should be running fine on GPU too! :face_with_raised_eyebrow:

But that’s the problem, it won’t run when I use the GPU, I’m using Google colab.

Hi Priestly,

Your notebook runs runs perfectly on my local GPU (Ubuntu 16.04 LTS, GTX 1070).

Maybe it is a problem with Google colab???