Open mikolajpabiszczak opened 3 years ago
Facing an error stating ValueError: 2 errors while building NodeDef 'tf_op_layer_Maximum/Maximum' using Op<name=Maximum; signature=x:T, y:T -> z:T; attr=T:type,allowed=[DT_BFLOAT16, DT_HALF, DT_FLOAT, DT_DOUBLE, DT_UINT8, DT_INT16, DT_INT32, DT_INT64]>:
on running the code with TF v2.3.
Was able to reproduce the issue with TF v2.4 and TF-nightly.
Please check the linked gist for reference. Thanks!
I was able to reproduce the issue with tf v2.5 ,Please check the gist ..Thanks !
Just bumping here: it still persists.
I was able to reproduce the issue on tf-nightly 2.10.0-dev20220719. Kindly find the gist of it here. Thank you!
Hi,
Thank you for opening this issue. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base.
The Tensorflow team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TensorFlow version with the latest compatible hardware configuration which could potentially resolve the issue. If you are still facing the issue, please create a new GitHub issue with your latest findings, with all the debugging information which could help us investigate.
Please follow the release notes to stay up to date with the latest developments which are happening in the Tensorflow space.
System information
Describe the current behavior Keras fails to load model due to problems with inferring data types in
tf.math.maximum
. In particular: take the input to the network to befloat32
, then cast the tensor tofloat64
and feed into maximum layer (with the second input to that layer beingfloat64
constant tensor) - creating this model is successful. Save that model (below I used SavedModel format, but .h5 case is similar) and try to load it - error is raised.Moreover, the error is raised only when the constant tensor is passed as first input to
tf.math.maxiumum
and does not occur if it is passed as the second input - see the Colab notebook I attached below.I believe this is strictly Keras-related, as I was able to successfully convert this failing-to-load model to to .tflite version (with proper options of converter set, using
from_saved_model
method) and this tflite model works and its' data types are correct.Describe the expected behavior The model should load properly.
Standalone code to reproduce the issue
This code snipper should reproduce the issue:
BTW: When using
x = tf.maximum(x, a)
instead ofx = tf.maximum(a, x)
in the example above, the error is not raised!See also slightly more elaborate Colab notebook.
Other info / logs