predict with Keras fails due to faulty environment setup

前端 未结 3 1130
慢半拍i
慢半拍i 2021-01-22 03:46

I can\'t get Keras to predict anything. Not even in this minimalistic model:

from keras.models import Sequential
from keras.layers import Dense
import numpy as np         


        
3条回答
  •  失恋的感觉
    2021-01-22 04:40

    I pasted your code into https://colab.research.google.com and it didn't give me an error. (python2)

    I did however get a warning about int to float conversion.

    I would try to specify the test_input dtype explicitly as in:

    test_input = np.zeros((1,inDim), dtype=float)
    

    Since that seems to be the error message that is being output.

提交回复
热议问题