Open mikechen66 opened 4 years ago
TypeError: compile() missing 1 required positional argument: 'optimizer'
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')
AttributeError: module 'tensorflow' has no attribute 'Session'
change the line of code
In[2]
sess = tf.Session()
to the following code
sess = tf.compat.v1.Session()
RuntimeError: set_session is not available when using TensorFlow 2.0.
set_session
delete the following code:
In [2]
K.set_session(sess)
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.
In[7]
classification_inputs = tf.saved_model.utils.build_tensor_info(serialized_tf_example) classification_outputs_classes = tf.saved_model.utils.build_tensor_info(prediction_classes) classification_outputs_scores = tf.saved_model.utils.build_tensor_info(values)
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]