Keras error ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'tensor ("embedding_1/random_uniform: 0", shape = (5001,128), dtype = float32 )',
Train and save the model on the server. After the model is copied to the local machine, the load_model () error is returned:
ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'tensor ("embedding_1/random_uniform: 0", shape = (5001,128), dtype = float32 )'
Cause: the configuration of the server and local running environment is different.
View the local keras version:
In [1]: import kerasUsing TensorFlow backend. In [2]: keras. _ version _ Out [2]: '2. 0.6'
(Alternatively, use pip freeze to list the version information of all packages)
The keras version on the server is 2.0.3.
Install the local pip install in the specified version:
$ Pip install Keras = 2.0.3