Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'tensorflow' has no attribute 'to_int32'

I am trying to implement CTC loss to audio files but I get the following error:

TensorFlow has no attribute 'to_int32'

I'm running tf.version 2.0.0.

I think it's with the version, I'm currently using, as we see the error is thrown in the package itself ' tensorflow_backend.py' code.

I have imported packages as "tensorflow.keras.class_name" with backend as K. Below is the screenshot.

enter image description here

like image 744
UnbreakableMystic Avatar asked Oct 27 '25 17:10

UnbreakableMystic


1 Answers

You can cast the tensor in TensorFlow 2 as follows:

tf.cast(my_tensor, tf.int32)

You can read the documentation of the method in https://www.tensorflow.org/api_docs/python/tf/cast

You can also see that the to_int32 is deprecated and was used in TensorFlow 1 https://www.tensorflow.org/api_docs/python/tf/compat/v1/to_int32

like image 122
David Avatar answered Oct 30 '25 08:10

David



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!