首页 > 其他 > 详细

Keras (Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(20000, 100), dtype=float32)')

时间:2017-09-10 20:26:43      阅读:8253      评论:0      收藏:0      [点我收藏+]

这个问题出现根本原因是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的环境重新训练模型最终加载训练好的模型成功

 

Keras (Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(20000, 100), dtype=float32)')

原文:http://www.cnblogs.com/wlc297984368/p/7501955.html

(3)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!