在用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. Json实体类驼峰名称转化器

    背景 我们常用一些网站,将json转化成实体类.但不巧的是,这些自动生成的都是小驼峰.需要进一步的改成大驼峰+JsonProperty.接着同事说他已经有个工具了.我稍微简化了一下 方法 首先行分离. ...

  2. 用Git从本地上传文件到GitHub

    这几天忙于抢救崩掉的博客,没空更新GitHub上PAT的代码,手动一个个传太慢了,所以我去偷学了一下给Git传文件到GitHub,非教学教程没有图文,有几个前提 你得有github账号,没有就去注册吧 ...

  3. Spring Boot2(006):关于配置类(Configuration Classes)和配置(Configuration)

    一.配置类(Configuration Classes) Spring Boot 支持基于 xml 的配置,但更偏向于使用基于 Java 的配置,通常建议使用定义有 main 方法的主 @Config ...

  4. cf 782# A.Andryusha and Socks B.The Meeting Place Cannot Be Changed C.Andryusha and Colored Balloons

    看来快掉到灰名的蒟蒻涨rating也快... A题模拟一下就好(一开始还sb,, #include<bits/stdc++.h> #define LL long long using na ...

  5. php.laravel.csrf

    概念请自己查 在全局帮助函数库Illuminate\Foundation\helpers.php中有以下几个函数定义,在看过前两个函数实现可以在使用中多少有点帮助. function csrf_fie ...

  6. Flutter Windows下AndroidStudio环境搭建

    目前同类产品比较知名的有ReactNative,Flutter还有国内那家了uniapp了,流畅度理论上Flutter最快 官网:https://flutter.dev/docs/get-starte ...

  7. Springboot跨域 ajax jsonp请求

    SpringBoot配置: <dependency> <groupId>org.springframework.boot</groupId> <artifac ...

  8. axios实现类似form传值的格式,以及实现拦截器功能,response拦截实现权限判断

    import axios from 'axios' import Qs from 'qs' // 超时设置 const service = axios.create({ transformReques ...

  9. Markdown工具推荐

    Markdown 因语法简单,应用广泛,在近几年被很多开发者所喜爱.常用的语法不多,也就十来种吧.本人自从2017年接触就一发不可收拾. 在这几年里,用过了很多写Markdown的工具.接下来就以现在 ...

  10. iOS 13适配

    1. 安装时,加入Xcode11.3 后 原xcode会安装开发工具插件时候出现 点击安装插件之后会出现 目前没找到解决方案.只能在一个mac电脑上安装使用一个版本. 2.编译时,会出现libstdc ...