_init_() got an unexpected keyword argument ‘shape’
按照《TensorFlow:实战Google深度学习框架》一书学习的tensorflow,书中使用的是0.9.0版本,而我安装的是1.11.0
如果按照书上的例子来,因为这本书使用tensorflow是0.9.0版本,而在最新的tensorflow中有很多改动,文章最后会附上这些改动以供参考查看。这里的错误是因为新版tf.zeros_initializer和tf.ones_initializer后面需要加括号,将v = tf.get_variable(“v”,initializer=tf.zeros_initializer(shape=[1]))改为v = tf.get_variable(“v”,initializer=tf.zeros_initializer( )(shape=[1]))就可以了,下面的一样
原文:https://blog.csdn.net/wqqgo/article/details/75675323
_init_() got an unexpected keyword argument ‘shape’的更多相关文章
- ypeError: __init__() got an unexpected keyword argument 'shape'
采用TensorFlow支持通过tf.Graph函数来生成新的向量图,代码如下: import tensorflow as tf g1 = tf.Graph() with g1.as_default( ...
- TypeError: to_categorical() got an unexpected keyword argument 'nb_classes'
在学习莫烦教程中keras教程时,报错:TypeError: to_categorical() got an unexpected keyword argument 'nb_classes',代码如下 ...
- senlin __init__() got an unexpected keyword argument 'additional_headers'
从senlin源码重新编译更新了服务,然后执行 senlin的 cli就遇到了错误: __init__() got an unexpected keyword argument 'additional ...
- TypeError: parse() got an unexpected keyword argument 'transport_encoding'
错误: TypeError: parse() got an unexpected keyword argument 'transport_encoding'You are using pip vers ...
- get() got an unexpected keyword argument
TypeError: get() got an unexpected keyword argument 'news_id'ERROR basehttp 154 "GET /news/3/ H ...
- TypeError: __init__() got an unexpected keyword argument 't_command'
python .\manage.py migrate 报错如下 λ python .\manage.py migrateTraceback (most recent call last): File ...
- TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'
错误: TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' 参照https://blog.c ...
- Django--bug--__init__() got an unexpected keyword argument 'qnique'
建立模型之后,执行迁移,报如下错误: __init__() got an unexpected keyword argument 'qnique' 错误原因:模型的属性的约束添加错误,这种错误一般就是 ...
- TypeError: pivot_table() got an unexpected keyword argument 'rows'
利用Python进行数据分析>第二章,处理MovieLens 1M数据集,有句代码总是报错: mean_rating = data.pivot_table('rating', rows='tit ...
随机推荐
- WWDC 2014 Session笔记 - iOS界面开发的大一统
本文是我的 WWDC 2014 笔记 中的一篇,涉及的 Session 有 What's New in Cocoa Touch Building Adaptive Apps with UIKit Wh ...
- [转]T-SQL_面试题
[转]T-SQL_面试题 2015-05-19 1 创建表插入数据 Student(S#,Sname,Sage,Ssex) 学生表 Course(C#,Cname,T#) 课程表 SC(S#,C#,s ...
- 实战 Lucene,第 1 部分: 初识 Lucene (zhuan)
http://www.ibm.com/developerworks/cn/Java/j-lo-lucene1/ ******************************************** ...
- hadoop3: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs’: Permission denied
1.hadoop3: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied把所有Datan ...
- 基于CSS3 3D百叶窗图像过渡特效
你可能已经在网上看到过不少使用jQuery制作的百叶窗效果,我们可不可以使用纯CSS来完成这项工作呢?答案是肯定的.我们不仅可以制作出这种百叶窗效果,还可以使它具有响应性. 在线预览 源码下载 要 ...
- kernel 4.4.12 移植 HUAWEI MU609 Mini PCIe Module
首先请参考 http://www.cnblogs.com/chenfulin5/p/6951290.html 上一章刚讲了 kernel 3.2.0 移植 MU609 这一章记录新版kernel 的移 ...
- [Linux内核]ctrl-z/fg/bg/nohup/setsid/()与&/disown/screen
转自:https://my.oschina.net/alphajay/blog/65058 My Tips: Ctrl -z -> suspend fg -> ...
- web.xml文件中<mime-mapping>
http://blog.csdn.net/sccemstanford/article/details/9064155 ————————————————————————————————————————— ...
- 很多人都不知道的监听微信、支付宝等移动app及浏览器的返回、后退、上一页按钮的事件方法
版权声明:本文为博主原创文章,未经博主允许不得转载. 在实际的应用中,我们常常需要实现在移动app和浏览器中点击返回.后退.上一页等按钮实现自己的关闭页面.调整到指定页面或执行一些其它操作的 需求,那 ...
- C++ 匿名对象产生场景
//匿名对象产生的三种场景 #include<iostream> using namespace std; class Point{ public: Point(int a,int b){ ...