Some tensorflow functions does not work but the code below solves the issue import tensorflow.compat.v1 as tf tf.disable_v2_behavior()