Pytorch study notes (7) - what should I do if the model often reports CUDA errors on the GPU

I believe that when many friends use deep learning, they put the model GPUon and run it, and then a bunch of related errors will be reported CUDA, so they started to Baidu how to fix these errors. Most of the results obtained may be how to upgrade CUDAand the like. After following the online process step by step, these problems were still unable to be solved.

In fact, all CUDAthe related errors I encountered have CUDAnothing to do with it. For example, it may be that the dimensions of your Embeddinglayer do not match the vocabulary, etc. When these errors occur, I suggest running the model on the CPU first to see if any errors occur, and then decide how to modify the code .

Guess you like

Origin blog.csdn.net/qq_35357274/article/details/123198435