在用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. TextView标签的属性和跑马灯效果

    text:显示的内容 textSize:文本的大小 textColor:文本的颜色 visibility:可见性  默认可见,invisible:表示不可见,但对控件的显示区域做了保留 gone:隐藏 ...

  2. 常见SQL语句杂谈(笔记)

    SQL语句(总结,完整的select语句) select distinct * from 表名 where ...group by ... having ...order by ... limit s ...

  3. Bug 佛祖镇楼

    原文链接:https://www.cnblogs.com/xdp-gacl/p/4198935.html // _ooOoo_ // o8888888o // 88" . "88 ...

  4. 114-PHP判断类变量是否相同

    <?php class ren{ //定义人类 } class mao{ //定义人类 } $ren=new ren(); //实例化人类的对象 $ren_a=new ren(); //实例化人 ...

  5. inkscape批量将svg转为pdf

    for i in *.svg;do inkscape --export-pdf=${i%.*}.pdf $i;done

  6. FTP故障排除

    1,ping 检查 IP是否通 禁PING可以使用TCPING 2,服务器端被动模式设置,可设置固定端口号,保证防火墙上该端口畅通 浏览器默认是主动模式 3,使用FLASHFXP软件可以监测到数据端口 ...

  7. Tornado的XSRF防范

    XSRF XSRF即为跨站请求伪造 这个漏洞利用了浏览器的一个允许恶意攻击者在受害者网站注入脚本使未授权请求代表一个已登录用户的安全漏洞. 了解XSRF 当一个网站的图片SRC属性为另一个网站的链接时 ...

  8. Linux课后练习(第二章命令)20200218

  9. jQuery实现点击div外的区域,来隐藏指定节点

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script sr ...

  10. 屏幕适配 - JS - 网站布局元素

    网页可见区域宽:document.body.clientWidth; 网页可见区域高:document.body.clientHeight; 网页可见区域高:document.body.offsetW ...