DataParallel multi-gpu RuntimeError: chunk expects at least a 1-dimensional tensor

Hi, I am trying to run my model on multiple gpus using DataParallel by setting model = nn.DataParallel(model).cuda(), but everytime getting this error - RuntimeError: chunk expects at least a 1-dimensional tensor (chunk at /pytorch/aten/src/ATen/native/TensorShape.cpp:184).

Could you check the shape of your input data?
nn.DataParallel splits the input tensor in dim0 and sends each chunk to the specified GPUs.
It seems you are trying to pass a 0-dimensional tensor?