_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 ...
随机推荐
- 【Android】14.3 浏览手机中的所有文件夹和文件
分类:C#.Android.VS2015: 创建日期:2016-02-27 一.简介 前面我们了解了内部存储.外部存储的含义,用一句话说,内部存储实际上是保存在"data"文件夹下 ...
- cnblogs博客迁移到hexo
cnblogs博客备份 备份地址:https://i.cnblogs.com/BlogBackup.aspx?type=1 备份文件为xml格式,打开备份文件,如下所示: <?xml versi ...
- 匈牙利命名法、骆驼命名法、帕斯卡(pascal)命名法 C#命名规范
匈牙利命名法.骆驼命名法.帕斯卡(pascal)命名法 C#命名规范 一.匈牙利命名法:广泛应用于象Microsoft Windows这样的环境中. Windows 编程中用到的变量(还包括宏)的命名 ...
- 搭建自己的GitHub Pages
本文记录博主使用Win 10操作系统和Jekyll 3.1.2搭建GitHub Pages的过程.希望能帮助到相同有需要的朋友. 基本需求 GitHub账号及一个命名为{GitHub昵称}.githu ...
- TCP状态图
TCP建立关闭连接状态图 MSL:Max segment lifetime最大段存活时间. MSL在RFC1122中规定为两分钟,但是各个操作系统的实现不同,在linux上一般配置MSL???? 处于 ...
- C++按行读取和写入文件
按行读取: 假设有一个文本文件,如下所示: 1 2 32 3 43 4 55 6 77 8 9 文件名为split.txt 目的:按照行读取数据,并一个个的显示出来. 代码如下: #include & ...
- 燕十八mysql笔记
mysql复习 一:复习前的准备 1:确认你已安装wamp 2:确认你已安装ecshop,并且ecshop的数据库名为shop 二 基础知识: 1.数据库的连接 mysql -u -p -h -u 用 ...
- CSS3 实现厉害的文字和输入框组合效果
最近在忙着弄网站,学到了不少效果,这又是一个厉害的 <html> <head> <meta http-equiv="Content-Type" co ...
- 那么类 Man 可以从类 Human 派生,类 Boy 可以从类 Man 派生
若在逻辑上 B 是 A 的“一种”(a kind of ),则允许 B 继承 A 的功 能和属性. 例如男人(Man)是人(Human)的一种,男孩(Boy)是男人的一种. 那么类 Man 可以从类 ...
- 在函数体的“出口处”,对 return 语句的正确性和效率进行检查
在函数体的“出口处”,对 return 语句的正确性和效率进行检查. 如果函数有返回值,那么函数的“出口处”是 return 语句. 我们不要轻视 return 语 句.如果 return 语句写得不 ...