unsupported operand type
收藏
为什么总是出现这个错误,本地之前跑的时候没问题呀
0
收藏
请登录后评论
float 和 str 运算类型错误了,看下代码中的数据类型是否匹配。
您好,我输入的数据是这样的
x_data = np.array([item[0] for item in data], dtype='float32').reshape(-1, 1,32,2880 )
y_data = np.array([item[1] for item in data], dtype='int64').reshape(-1, 1)
# 将numpy.ndarray转化成Tensor
img = fluid.dygraph.to_variable(x_data)
label = fluid.dygraph.to_variable(y_data)
建议你先把filter_elem_num这个变量打印一下,看看是不是类型不对