首页 Paddle框架 帖子详情
尝试房价预测项目代码没有mse_cost的问题
收藏
快速回复
Paddle框架 问答深度学习 1411 3
尝试房价预测项目代码没有mse_cost的问题
收藏
快速回复
Paddle框架 问答深度学习 1411 3
import paddle.v2 as pdl
import paddle.v2.dataset.uci_housing as uci_housing
#模型初始化
pdl.init(use_gpu=False,trainer_count=1)

#数据
x = pdl.layer.data(name='x', type=pdl.data_type.dense_vector(13))
y_predict = pdl.layer.fc(input=x, size=1, act=pdl.activation.Linear())
y = pdl.layer.data(name='y',type=pdl.data_type.dense_vector(1))
cost=pdl.layer.mse_cost(input=y_predict,lable=y)

错误提示:

Traceback (most recent call last):
  File "//home/yuyingying/pythonProject/tryPaddle1/tryPaddle1.py", line 11, in 
    cost=pdl.layer.mse_cost(input=y_predict,lable=y)
AttributeError: 'module' object has no attribute 'mse_cost'

 是说没有mse_cost? 请问怎么解决这个问题?谢谢!

0
收藏
回复
全部评论(3)
时间顺序
ccpcbear
#2 回复于2018-07

paddle的layer类里面没有mse_cost这个训练价值函数啊,是不是从哪里引用来的

0
回复
夜雨飘零1
#3 回复于2018-07

我在文档上没看到你这个函数哦,http://www.paddlepaddle.org/docs/0.11.0/documentation/zh/api/v2/config/layer.html#permalink-88-cost-layers

是不是你写错了,还是版本问题?

0
回复
w
wxmlol
#4 回复于2018-08

是使用square_error_cost这个函数

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