zoukankan      html  css  js  c++  java
  • Keras (Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(20000, 100), dtype=float32)')

    这个问题出现根本原因是keras以及tensorflow的版本(服务器与本地)不一致

    通过

    Python

          import keras,tensorflow

          keras.__version__ 

          tensorflow.__version__

    查看版本 然后通过 pip uninstall XXXX pip install install XXX版本号指定安装版本使得服务器与本机版本一致

    本以为这个操作就可以解决问题结果依然还是Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(20000, 100), dtype=float32)'

    原来还有python版本的问题

    在服务器用的Python2.7训练的模型,在window上面Python2.7不支持TensorFlow

    因此在服务器上重新建立虚拟环境配置python3的环境重新训练模型最终加载训练好的模型成功

  • 相关阅读:
    sshpass做秘钥分发,ansible做自动化运维工具
    Day7 面向对象和类的介绍
    R-aggregate()
    R-seq()
    R-ts()
    R-ets()
    python-无联网情况下安装skt-learn
    python-线性回归预测
    python-matplotlib-ERROR
    python-pyhs2
  • 原文地址:https://www.cnblogs.com/wlc297984368/p/7501955.html
Copyright © 2011-2022 走看看