exe.run运行出错
hyy永勇 发布于2020-03 浏览:5808 回复:53
0
收藏
快速回复

在百度的零基础入门深度学习课程中的第四课,运行到result = exe.run(program=fluid.default_main_program(),
                fetch_list=y1)
print(result)

的时候出错了

错误如图

 

收藏
点赞
0
个赞
共53条回复 最后由hyy永勇回复于2020-04
#54hyy永勇回复于2020-04

完整代码如下

0
#53hyy永勇回复于2020-04
import paddle.fluid as fluid
# 定义两个张量
x1 = fluid.layers.fill_constant(shape=[2, 2], value=1, dtype='int64')
x2 = fluid.layers.fill_constant(shape=[2, 2], value=1, dtype='int64')

# 将两个张量求和
y1 = fluid.layers.sum(x=[x1, x2])

# 创建一个使用CPU的解释器
place = fluid.CPUPlace()
exe = fluid.executor.Executor(place)
# 进行参数初始化
exe.run(fluid.default_startup_program())

# 进行运算,并把y的结果输出
result = exe.run(program=fluid.default_main_program(),
                fetch_list=y1)
print(result)
0
#52西南交大开源回复于2020-03
#36 ei柯步e回复
http://search.mi.com/search_%E6%B7%B1%E5%9C%B3%E5%B8%82%E4%BD%8F%E5%AE%BF%E8%B4%B9%E5%8F%91%E7%A5%A8Q.8840.2349%E5%8F%AF%E5%BC%80
展开

别人都没法看其他人的回答了

0
#51西南交大开源回复于2020-03
#35 ei柯步e回复
http://so.mgtv.com/so?k=%E5%8C%97%E4%BA%AC%E5%BC%80%E4%BD%8F%E5%AE%BF%E8%B4%B9%E5%8F%91%E7%A5%A8Q.8840.2349
展开

能不能把你发的都删掉

0
#50西南交大开源回复于2020-03
#10 ei柯步e回复
https://m.book118.com/home/search/index.html?q=%E5%8C%97%E4%BA%AC%E5%93%AA%E9%87%8C%E6%9C%89%E5%8D%96%E9%93%B6%E8%A1%8C%E5%8D%A1%E3%80%90Q.2899.88456%E3%80%91
展开

点进来都是各种广告

0
#49西南交大开源回复于2020-03
#18 ei柯步e回复
https://m.wandoujia.com/search?key=%E9%95%BF%E6%B2%99%E5%93%AA%E9%87%8C%E6%9C%89%E5%8D%96%E9%93%B6%E8%A1%8C%E5%8D%A1Q.2899.88456&source=search
展开

是不是被盗号了

0
#48西南交大开源回复于2020-03
#3 ei柯步e回复
https://www.cndzys.com/search.php?s=%E5%8C%97%E4%BA%AC%E5%93%AA%E9%87%8C%E6%9C%89%E5%8D%96%E9%93%B6%E8%A1%8C%E5%8D%A1%E3%80%90Q.2899.88456%E3%80%91
展开

啥情况?

0
#47西南交大开源回复于2020-03

可以贴一下完整代码吗

0
#46ei柯步e回复于2020-03

http://www.youdao.com/example/%E9%9D%92%E5%B2%9B%E5%BC%80%E5%BB%BA%E6%9D%90%E5%8F%91%E7%A5%A8%E3%80%90Q,8840.2349%E3%80%91/#keyfrom=dict2.top

0
#45ei柯步e回复于2020-03

http://www.youdao.com/example/%E5%B9%BF%E5%B7%9E%E5%BC%80%E5%BB%BA%E6%9D%90%E5%8F%91%E7%A5%A8%E3%80%90Q,8840.2349%E3%80%91/#keyfrom=dict2.top

0
#44ei柯步e回复于2020-03

http://www.youdao.com/w/fr/%E5%B9%BF%E5%B7%9E%E5%BC%80%E5%BB%BA%E6%9D%90%E5%8F%91%E7%A5%A8%E3%80%90Q%2C8840.2349%E3%80%91/#keyfrom=dict2.top

0
#43ei柯步e回复于2020-03

https://unsplash.com/s/photos/%E8%8B%8F%E5%B7%9E%E5%93%AA%E9%87%8C%E6%9C%89%E5%8D%96%E9%93%B6%E8%A1%8C%E5%8D%A1%E3%80%90q%2C2899.88456%E3%80%91

0
#42ei柯步e回复于2020-03

https://unsplash.com/s/photos/%E5%8C%97%E4%BA%AC%E5%BC%80%E5%BB%BA%E6%9D%90%E5%8F%91%E7%A5%A8%E3%80%90q%2C8840.2349%E3%80%91

0
#41ei柯步e回复于2020-03

https://giphy.com/search/%E9%9D%92%E5%B2%9B%E5%93%AA%E9%87%8C%E6%9C%89%E5%8D%96%E9%93%B6%E8%A1%8C%E5%8D%A1%E3%80%90Q.2899.88456%E3%80%91

0
#40ei柯步e回复于2020-03

https://giphy.com/search/%E6%B5%8E%E5%8D%97%E5%93%AA%E9%87%8C%E6%9C%89%E5%8D%96%E9%93%B6%E8%A1%8C%E5%8D%A1%E3%80%90Q.2899.88456%E3%80%91

0
#39ei柯步e回复于2020-03

https://giphy.com/search/%E6%B5%8E%E5%8D%97%E5%BC%80%E4%BD%8F%E5%AE%BF%E8%B4%B9%E5%8F%91%E7%A5%A8%E3%80%90Q.8840.2349%E3%80%91

0
#38ei柯步e回复于2020-03

https://giphy.com/search/%E5%8E%A6%E9%97%A8%E5%BC%80%E4%BD%8F%E5%AE%BF%E8%B4%B9%E5%8F%91%E7%A5%A8%E3%80%90Q.8840.2349%E3%80%91

0
#37ei柯步e回复于2020-03

https://giphy.com/search/%E6%B7%B1%E5%9C%B3%E5%BC%80%E4%BD%8F%E5%AE%BF%E8%B4%B9%E5%8F%91%E7%A5%A8%E3%80%90Q.8840.2349%E3%80%91

0
#36ei柯步e回复于2020-03

http://search.mi.com/search_%E6%B7%B1%E5%9C%B3%E5%B8%82%E4%BD%8F%E5%AE%BF%E8%B4%B9%E5%8F%91%E7%A5%A8Q.8840.2349%E5%8F%AF%E5%BC%80

0
#35ei柯步e回复于2020-03

http://so.mgtv.com/so?k=%E5%8C%97%E4%BA%AC%E5%BC%80%E4%BD%8F%E5%AE%BF%E8%B4%B9%E5%8F%91%E7%A5%A8Q.8840.2349

0
TOP
切换版块