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 ...
随机推荐
- DragonFlyBSD 5.6 RC1 发布
导读DragonFlyBSD操作系统下一个主要版本的第一个候选版本RC1现在可以进行测试.DragonFlyBSD 5.6将成为一个功能更新的版本,该功能更新将于周二晚上发布,是第一个候选版本,同时将 ...
- sqlite if not exists应用实例
INSERT or replace INTO [main].[RecordInfo]([WorkID],[bArtificialAttendance],[fThreshold],[Attendance ...
- SpringMVC核心
DispatcherServlet是前端控制器设计模式的实现,提供Spring Web MVC的集中访问点,而且负责职责的分派,与spring IoC容器无缝集成. 主要用作职责调度工作,本身主要用于 ...
- Redis 详解 (六) RDB 持久化
目录 1.RDB 简介 2.触发方式 ①.自动触发 ②.手动触发 3.恢复数据 4.停止 RDB 持久化 5.RDB 的优势和劣势 6.RDB 自动保存的原理 前面我们说过,Redis 相对于 Me ...
- 【LeetCode 】验证回文串
[问题]给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写.说明:本题中,我们将空字符串定义为有效的回文串. 示例 : 输入: "A man, a plan, a ...
- M3U8地址在谷歌浏览器中播放
该案例git码云地址:https://gitee.com/kawhileonardfans/hls-player-example 1.下载插件 插件地址:https://files.cnblogs.c ...
- R apply()函数
创建一个列表变量,它的第一个元素包含所有从0到9的平方数,第二个元素为10到19之内的所有平方数,依此类推,最后一个元素为90到99之内的平方数.没有平方数的元素也应该被包含在内! 学习网友的解题思路 ...
- Oracle-SQL 建表
建立员工分类表: 员工分类表结构.内容分别如下图: 一.使用PL/SQL Dev 这类可视化工具直接创建表 1.建立表结构 新建-table-名称(egrade) 然后 列:创建表结构 2. ...
- 设置虚拟机静态ip
1.查看本机ip.网关.dns服务器 IPv4地址:本机局域网ip 路由器:网关地址 nameserver:局域网内部dns服务器 其他dns服务器 移动.电信和联通:114.114.114.114 ...
- C# Stream篇(六) -- BufferedStream
BufferedStream 目录: 简单介绍一下BufferedStream 如何理解缓冲区? BufferedStream的优势 从BufferedStream 中学习装饰模式 如何理解装饰模式 ...