Tensorflow model import to Java

前端 未结 3 540
梦谈多话
梦谈多话 2021-02-06 12:03

I have been trying to import and make use of my trained model (Tensorflow, Python) in Java.

I was able to save the model in Python, but encountered problems when I try t

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-06 12:43

    Your python-model will certainly fail at this:

    sess.run(init) #<---this will fail
    save_model(sess)
    error = tf.reduce_mean(tf.square(prediction - y))
    
    #accuracy = tf.reduce_mean(tf.cast(error, 'float'))
    print('Error:', error)
    

    init is not defined in the model - I'm unsure what you want achieve at this place, but that should give you a starting point

提交回复
热议问题