轴与pytorch中的数组错误不匹配

Axes don't match array error in pytorch

我正在尝试 运行 pytorch 中的 vnet 实现 (https://github.com/mattmacy/vnet.pytorch) 并在使用

规范化扫描后
x_max = 512 
y_max = 512 
z_max = 500 
voxspacing = 0.7 

当我在 for 循环通过数据加载器枚举的行上调用 tran 函数时,我得到一个

axes don't match array error.

我不知道如何解决这个问题。任何帮助都会非常有帮助。我是机器学习新手

注释第 417 和 418 行。问题将得到解决

问题是因为这两行

if self.transform is not None:
     img = self.transform(img)