在用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.的更多相关文章

  1. 解决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 ...

  2. 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 ...

  3. python报错 TypeError: a() got multiple values for argument 'name'

    [问题现象] 在一次调用修饰函数中出现了问题,折腾了一下午,一直报错 TypeError:  got multiple values for argument 只是很简单的调用 from tsu2Ru ...

  4. TypeError: test() got multiple values for keyword argument 'key'

    原因是: 1.函数调用的最终形式只会调用两个函数.一个list参数和一个dict参数,格式为call(func, list, dict); 2.如果传入参数中有key参数,那么首先key参数(包括扩展 ...

  5. Python TypeError: __init__() got multiple values for argument 'master'(转)

    转自:https://stackoverflow.com/questions/33153404/python-typeerror-init-got-multiple-values-for-argume ...

  6. python 字典 dict items values keys

    dict.items() 1 >>> d = dict(one=1,two=2) 2 >>> it1 = d.items() 3 >>> it1 ...

  7. day5:字典dict

    1, 判断是不是列表 li = ['lis3a', 'mary', 'lucy', 'hh', 'kk', 'gg', 'mm', 'oo', 'vv'] if type(li) == list: p ...

  8. 字典dict常用方法

    字典是列表中常用的方法,我们经常处理字典,字典嵌套,很多复杂的操作都来自于基础,只是改变了样式而已,本质是不变的.下面来看看字典中常用的功能都有那些:     1.clear(self) def cl ...

  9. 第五章:深入Python的dict和set

    第五章:深入Python的dict和set 课程:Python3高级核心技术 5.1 dict的abc继承关系 class Mapping(Collection): __slots__ = () &q ...

随机推荐

  1. Linux netfliter 架构

    netfliter 简介 netfilter是在Linux 2.4.X内核引入的一个子系统,它提供了一个抽象的.通用框架,这个框架提供了一整套的钩子函数的管理机制.包括钩子函数的原型定义,注册,注销等 ...

  2. JS - 对话框

    1,<span onclick="return confirmAct();">执行操作</span> 2, function confirmAct(){ i ...

  3. Oracle 查询当前用户下的所有表

    select table_name from user_tables;

  4. 【WPF学习】第二十四章 基于范围的控件

    WPF提供了三个使用范围概念的控件.这些控件使用在特定最小值和最大值之间的数值.这些控件——ScrollBar.ProgressBar以及Slider——都继承自RangeBase类(该类又继承自Co ...

  5. 二十一、JavaScript之访问对象属性

    一.代码如下 二.执行效果如下 <!DOCTYPE html> <html> <meta http-equiv="Content-Type" cont ...

  6. pycharm 配置 github 版本控制 VCS

    场景:github上没有repository,将pycharm中的工程push到github 1.在pycharm中登录github 2.新建工程后,选择“share project on githu ...

  7. SPOJ RENT 01背包的活用+二分

    这个题目给定N航班的发出时间和结束时间以及价值,要求不冲突时间的最大价值 第一时间想到经典的N方DP,即对航班按发出时间排一下序之后每个i对前面的都扫一遍 时间过不了N有10万,只能想优化了,一开始想 ...

  8. 实验吧-杂项-你知道他是谁吗?(转盘密码、NTFS数据流检测及导出)

    刚看到的时候听懵,没注意到重点,其实很多时候题目中的细节就是给我们线索的,所以审题和思考是很重要的. 在没做到点上的是,也做了一点努力,没有效果,科普一下这个人((*^▽^*))图片上是托马斯.杰斐逊 ...

  9. 一、VIP课程:互联网工程专题 04-Maven私服使用与插件开发

    第四课:Maven私服构建与插件开发.docx 一.maven 生命周期 知识点概要: 生命周期的概念与意义 maven 三大生命周期与其对应的phase(阶段) 生命周期与插件的关系 生命周期与默认 ...

  10. yagmail四行代码发送邮件

    yagmail四行代码发送邮件 import yagmail # 链接邮箱服务器 yag = yagmail.SMTP(user="xxxx@163.com", password= ...