Solved by SimonW in post #2 
              
              
                HorizontalFlip works on images. You should put it before ToTensor. The error message is from pytorch’s transpose. The code intended to call numpy/PIL transpose by doing img.trasnpose