Solved by ptrblck in post #2 
              
              
                Sure! 
The important part creating your own Dataset is to get the shapes for the data and target right. 
In a simple segmentation use case where each pixel can only belongs to a single class, we would want to use a criterion like nn.CrossEntropyLoss. 
Therefore your data should have the input shape …