I encountered a very speechless mistake today. I have been tossing for a long time...I can't use the feature network after using Bert...Checked the size problem and found that it is not. Later, I found that it was not placed on cuda...
RuntimeError: Caught RuntimeError in replica 0 on device 0. RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)
# Change from ext_hashCodes.unsqueeze(1).repeat(1, B, 1) # to ext_hashCodes.unsqueeze(1).repeat(1, B, 1).cuda()
and then it will be OK.