I figured it out… turns out it is the incompatibility of the data type. since I defined the model on cuda, I need to copy the data (images and labels) onto cuda as well. And apparently “target” expects long tensor