Skip to content
Advertisement

Getting attribute error when using AUTOTUNE in Tensorflow?

I am using AUTOTUNE for audio processing.

import tensorflow as tf
AUTOTUNE = tf.data.AUTOTUNE

But i am getting attribute error which said “module ‘tensorflow._api.v2.data’ has no attribute ‘AUTOTUNE'”. Tensorflow version is 2.3.0. How to solve this?

Advertisement

Answer

According to the TensorFlow 2.3 documentation, AUTOTUNE lies under the tensorflow.data.experimental namespace. So using

AUTOTUNE = tf.data.experimental.AUTOTUNE

should avoid this error.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement