Keras error ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: & #39; Tensor (& quot; embedding_1/random_uniform: 0 & quot;, shape = (5001,128 ), dtype = float32) & #39 ;,

Source: Internet
Author: User
Tags keras

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.