I need to annotation tensors to be batchSize*1*256*256 with 0 and 1 pixel values. But when I tried to load them using Dataset class, the tensors just become the rgb channel images. Where should I change ?
Besides,  is there any difference between the following two ways to save models? I used the  second one
torch.save(my_net.state_dict(), "my_net.pth")
torch.save( my_net,"my_net.pth")