Open triumph-wangyuyang opened 1 year ago
@triumph-wangyuyang, The exception information is auto-generated based on kernel registrations. You will need to update the python docstrings. Thank you!
update the python docstrings
Thank you for your reply, what is the specific operation, I did not understand the meaning of "update the python docstrings".
The exception information is auto-generated based on kernel registrations. You will need to update the python docstrings. Thank you!
Hello, I have changed here, but the problem still exists, can you answer it?
@triumph-wangyuyang, The exception information is auto-generated based on kernel registrations. You will need to update the python docstrings. Thank you!
Hi, can you explain to me why these problems occur?
@gowthamkpr, I was able to reproduce the issue on tensorflow v2.9, v2.11 and nightly. Kindly find the gist of it here.
System information.
Describe the problem.
The exceptions thrown by tf.keras.metrics.mean_absolute_error(y_true, y_pred) are different when running the following two test codes. In code1, I set y_pred to bool, and the exception message prompts me that bool is not in the legal type (bfloat16, half, float, double, uint8, int8, uint16, int16, int32, int64, complex64, complex128, uint32, uint64) (Remember that it includes uint16, which will be useful later). In code2, I set y_pred to uint16, and the exception information reminded me that uint16 is not in the legal type (bfloat16, half, float, double, int8, int16, int32, int64). It is obvious that the exception information before and after is contradictory. In addition, tf.keras.metrics.mean_absolute_percentage_error, tf.keras.metrics.mape, tf.keras.metrics.MAPE, tf.keras.metrics.mae, tf.keras.metrics.MAE, tf.keras.losses.mean_absolute_error, tf.keras.losses.mean_absolute_percentage_error, tf.keras.losses.mape, tf.keras.losses.MAPE, tf.keras.losses.mae, tf.keras.losses.MAE all have the same doubt.
Standalone code to reproduce the issue.
code 1:
code1 result : tensorflow.python.framework.errors_impl.InvalidArgumentError: Value for attr 'T' of bool is not in the list of allowed values: bfloat16, half, float, double, uint8, int8, uint16, int16, int32, int64, complex64, complex128, uint32, uint64; NodeDef: {{node Sub}}; Op<name=Sub; signature=x:T, y:T -> z:T; attr=T:type,allowed=[DT_BFLOAT16, DT_HALF, DT_FLOAT, DT_DOUBLE, DT_UINT8, DT_INT8, DT_UINT16, DT_INT16, DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128, DT_UINT32, DT_UINT64]> [Op:Sub]
code 2:
code2 result : tensorflow.python.framework.errors_impl.InvalidArgumentError: Value for attr 'T' of uint16 is not in the list of allowed values: bfloat16, half, float, double, int8, int16, int32, int64; NodeDef: {{node Abs}}; Op<name=Abs; signature=x:T -> y:T; attr=T:type,allowed=[DT_BFLOAT16, DT_HALF, DT_FLOAT, DT_DOUBLE, DT_INT8, DT_INT16, DT_INT32, DT_INT64]> [Op:Abs]