PyTorch Error: RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling cublasSgemm()

Complete error reporting information

RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when 
calling `cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, 
lda, b, ldb, &beta, c, ldc)`

Error causes and solutions

Usually linear layer

n

n

.

L

i

n

e

a

r

\rm nn.Linear

NN. When defining linear, the data dimension parameter does not match the actual data dimension, so it needs to be checked and modified.

Read More: