Pytorch报错解决:The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimensio
报错内容报错分析在执行F.normalize(tensor,self.mean,self.std,self.inplace)时,出现了tensor维度不匹配的问题(在axis=0的轴上,需要3维,得到的tensor为4维),该函数由img=self.transform(img)调用,因此可以判断在执行self.transform(img)前得到的img维度就不对,即读取的img包含RGBA四个通道