You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
mikechen66
changed the title
16.2 Prepare Keras model for Tensorflow Serving - TensorFlow Compatibility Issue
16.2 Prepare Keras model for Tensorflow Serving - TensorFlow 2.0Compatibility Issue
May 12, 2020
mikechen66
changed the title
16.2 Prepare Keras model for Tensorflow Serving - TensorFlow 2.0Compatibility Issue
16.2 Prepare Keras model for Tensorflow Serving - TensorFlow 2.0 Compatibility Issue
May 12, 2020
1. TypeError:
Issue:
TypeError: compile() missing 1 required positional argument: 'optimizer'
Solution:
In [2]:
change the following line of code
new_model.compile()
to the line of code as follows.
new_model.compile(optimizer='rmsprop',loss='mse')
2. AttributeError
Issue
AttributeError: module 'tensorflow' has no attribute 'Session'
Solution:
change the line of code
In[2]
sess = tf.Session()
to the following code
sess = tf.compat.v1.Session()
3. RuntimeError
Issue:
RuntimeError:
set_session
is not available when using TensorFlow 2.0.Solution:
delete the following code:
In [2]
K.set_session(sess)
3. AttributeError:
AttributeError: module 'tensorflow_core._api.v2.saved_model' has no attribute 'utils'
In [6]
input_info = tf.saved_model.utils.build_tensor_info(new_model.inputs[0])
The error is hard to be corrected. It has many dependencies. Now I have no solution to the AttributeError.
AttributeError: module 'tensorflow_core._api.v2.saved_model' has no attribute 'utils'
In[7]
The text was updated successfully, but these errors were encountered: