I checked again by removing the CUDA and y using the CPU as you suggested. I got a different error compared to last time. My new error message is "index out of range in self ". I found the problem with the embedding definition and fixed it now. Thank you for your help.