首页 Paddle框架 帖子详情
unsupported operand type
收藏
快速回复
Paddle框架 问答深度学习模型训练炼丹技巧 672 3
unsupported operand type
收藏
快速回复
Paddle框架 问答深度学习模型训练炼丹技巧 672 3

为什么总是出现这个错误,本地之前跑的时候没问题呀

0
收藏
回复
全部评论(3)
时间顺序
HolliZhao
#2 回复于2020-05

float 和 str 运算类型错误了,看下代码中的数据类型是否匹配。

0
回复
泪如秋思化成雪
#3 回复于2020-05

您好,我输入的数据是这样的

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)

0
回复
thinc
#4 回复于2020-05
您好,我输入的数据是这样的 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这个变量打印一下,看看是不是类型不对

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户