The input tensor of CRNN is cropped from an tensor of image, when I convert the tensor to PIL image and convert it back, the code works well.
img_out = ToTensor()(ToPILImage()(img_out.squeeze(0))).unsqueeze(0)
and the following code also helps:
img_out = torch.ones(img_out_.shape)
img_out.data = img_out_.clone()

Could anyone tell me the differences between cropped tensor and tensor converted from image?