RuntimeError: Expected object of scalar type Float but got scalar type Double for argument #2 ‘mat1‘

解决方法:

在DataSet初始化函数中,显示指明dtype为np.float32
self.datas = np.array(datas ,dtype=np.float32)

参考链接:

https://stackoverflow.com/questions/60020184/runtimeerror-expected-object-of-scalar-type-float-but-got-scalar-type-double-fo

猜你喜欢

转载自blog.csdn.net/hbu_pig/article/details/108891939
今日推荐