我想要比较两个图像,但是ms_ssim想要4D张量
from PIL import Imagefrom pytorch_msssim import= Image.open(path1) #it1=np.expand_dims(totensor(topil(np.array((np.expand_dims(np.array(image1), a
然后,我尝试使用img = Image.fromarray(img.astype('uint8'), mode='RGB')将其转换为PIL图像,但返回的img的尺寸是(28, 28),而我期望它是(28PIL版本1.1.7 # This code implements the __getitem__ function for a child class of datasets.MNIST in pytorch[