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 ...
随机推荐
- 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-cog
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...
- 08 SSM整合案例(企业权限管理系统):05.SSM整合案例的基本介绍
04.AdminLTE的基本介绍 05.SSM整合案例的基本介绍 06.产品操作 07.订单操作 08.权限控制 09.用户和角色操作 10.权限关联 11.AOP日志 05.SSM整合案例的基本介绍 ...
- HihoCoder第九周 状态压缩 二 与POJ2411总结
在此我向各位博友求助,特别想知道除了HihoCoder上面的结果要对1e9+7取余之外,这两道题还有什么其他的问题,都是骨牌覆盖问题,都是状态压缩+dp,为什么我能过poj2411的程序过不了Hiho ...
- Redis 详解 (一) redis的简介和安装
目录 1.Redis 的简介 2.Redis 下载 3.安装环境 4.编译安装 5.启动Redis 6.关闭Redis 7.注意事项 工作中一直在用 Redis,但是一直没有进行系统的总结,这个系列的 ...
- idea创建同名的maven工程时报错:Failed to create a Maven project 'xxx/pom.xml' already exists in VFS
1.说明 原先有个 xxx 的 maven 工程,然后删掉了,又重新建了个同名的工程,而且目录也一样,结果报错: 可以在 Help ==> Show Log in Explorer 查看到以下具 ...
- 留学生如何完成一篇高质量的Essay?
本文将以典型的essay写作结构作为框架, 分别介绍如何审题.构思.立意, 如何高效地收集有效的资料, 如何撰写, 如何规范参考文献格式等. 审题&构思&立意定题 审题 一年之计在于春 ...
- (排序EX)P1583 魔法照片
题解: 需要注意的是,快排完之后并不是按照编号从小到大的顺序输出 #include<iostream>using namespace std;int r=0;void swap(int & ...
- python虚拟环境配置(下)
前言 嘿,各位小伙伴们,晚上好呀,新年快乐,注意预防流感哈,就不要出去浪了,万一中奖了,嗯...,还是当个宅男,宅男无敌,哈哈哈, 过年了,村都被封了,哎,出都出不去,想着干点啥,就把以前没完善的继续 ...
- Objective-C 和 Swift 第三方库使用
https://www.jianshu.com/p/6be32a047ca7 原文地址: Objective-C 和 Swift 第三方库使用 注1:文章写于2016年9月,(swift 3.0.Xc ...
- matplotlib画图实例-day1
matplotlib主要用于根据数据画各种图表 官网:https://matplotlib.org/gallery/index.html 例1:画一天中每个两个小时温度变化趋势图 #!/usr/bin ...