datasetloader使用python-opencv报错:RuntimeError: value cannot be converted to type uint8_t without......
原文链接:https://blog.csdn.net/qq_40369180/article/details/104896719RuntimeError: value cannot be converted to type uint8_t without overflow:解决:将图像数据归一化img = img / 255RuntimeError: Expected object of scal
·
原文链接:https://blog.csdn.net/qq_40369180/article/details/104896719
RuntimeError: value cannot be converted to type uint8_t without overflow:
解决:将图像数据归一化
img = img / 255
RuntimeError: Expected object of scalar type Double but got scalar type Float for argument #3 ‘mat1’ in call to th_addmm
解决:将输入数据转换为Double,即float32
def forward(self, x):
x = torch.tensor(x, dtype=torch.float32)#数据转换
out = self.conv(x)
out = out.view(out.size(0), 1080)
out = self.fc(out)
return out
更多推荐
所有评论(0)