TypeError: TF_SessionRun_wrapper: expected all values in input dict to be ndarray.
在用Embedding时出现了这个问题,具体的代码:
model.add(Embedding(input_dim = vocab_size, output_dim = embedding_vector_size, input_length = max_len, weights = [embedding_matrix]))
本来以为是参数类型的问题,但怎么也找不出来,最后看github发现了解决方法:重装numpy(我也不知道为什么—.—)
记住在重装numpy的时候要关掉你的IDE或jupyter notebook,不然会出现类似:
PermissionError: [WinError 5] 拒绝访问。的警告,可能导致删不干净。
然后重装numpy即可
pip uninstall numpy
pip install numpy
TypeError: TF_SessionRun_wrapper: expected all values in input dict to be ndarray.的更多相关文章
- 解决tensorflow模型保存时Saver报错:TypeError: TF_SessionRun_wrapper: expected all values in input dict to be ndarray
TypeError: TF_SessionRun_wrapper: expected all values in input dict to be ndarray 对于下面的实际代码: import ...
- for遍历用例数据时,报错:TypeError: list indices must be integers, not dict,'int' object is not iterable解决方法
一:报错:TypeError: list indices must be integers, not dict for i in range(0,len(test_data)): suite.addT ...
- python报错 TypeError: a() got multiple values for argument 'name'
[问题现象] 在一次调用修饰函数中出现了问题,折腾了一下午,一直报错 TypeError: got multiple values for argument 只是很简单的调用 from tsu2Ru ...
- TypeError: test() got multiple values for keyword argument 'key'
原因是: 1.函数调用的最终形式只会调用两个函数.一个list参数和一个dict参数,格式为call(func, list, dict); 2.如果传入参数中有key参数,那么首先key参数(包括扩展 ...
- Python TypeError: __init__() got multiple values for argument 'master'(转)
转自:https://stackoverflow.com/questions/33153404/python-typeerror-init-got-multiple-values-for-argume ...
- python 字典 dict items values keys
dict.items() 1 >>> d = dict(one=1,two=2) 2 >>> it1 = d.items() 3 >>> it1 ...
- day5:字典dict
1, 判断是不是列表 li = ['lis3a', 'mary', 'lucy', 'hh', 'kk', 'gg', 'mm', 'oo', 'vv'] if type(li) == list: p ...
- 字典dict常用方法
字典是列表中常用的方法,我们经常处理字典,字典嵌套,很多复杂的操作都来自于基础,只是改变了样式而已,本质是不变的.下面来看看字典中常用的功能都有那些: 1.clear(self) def cl ...
- 第五章:深入Python的dict和set
第五章:深入Python的dict和set 课程:Python3高级核心技术 5.1 dict的abc继承关系 class Mapping(Collection): __slots__ = () &q ...
随机推荐
- ffmpeg 多路实时问题之解决思路
记得前面有人提出多路视频不实时问题,这个首先需要从网络带宽上查看是否视频帧全实时的到达,还有一个问题就是,即使视频帧全部到达,看起CPU也是足够的,但是却表现为慢镜头这种样子,那么很可能是解码显示的 ...
- 【Leetcode】交替打印FooBar
[问题]我们提供一个类: class FooBar { public void foo() { ; i < n; i++) { print("foo"); } } publi ...
- Centos 时间与主机时间不匹配问题解决
有时候新安装的虚拟机的系统时间会和主机的时间差8个小时,这是因为虚拟机和主机所在的时区不同. 这会导致当你往mysql数据库插入数据时如果设置时间为current_time结果会和虚拟机保持一致. 1 ...
- 杭电oj3306:Another kind of Fibonacci(矩阵快速幂)
Another kind of Fibonacci 题目链接 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (J ...
- mysql union 和union all
http://www.w3school.com.cn/sql/sql_union.asp
- enlipse 快捷键
ctrl+shift+o 去掉多余的引用类
- (六--一)scrapy框架简介和基础应用
一 什么是scrapy框架 官方解释 Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架. 可以应用在包括数据挖掘,信息处理或存储历史数据等一系列的程序中. 其最初是为了 页面抓取 ( ...
- 记-OSPF学习
LSA Type 1:Router LSA1.传播范围 :只能在本区域2.通告者 :每台路由器 (router-id作为标识)3.内容 :路由和拓扑信息show ip ospf database ro ...
- P 1027 打印沙漏
转跳点:
- int *const 与const int *问题
自己一直就不太清楚int *const与const int*之间的差别,总是弄混,今天势必拿一个程序验证一下. 一个指针是有两个属性的,一个是它指向的地方,一个是它指向地方上的内容.两者的差别也在此. ...