Module 'tensorflow.compat.v2.__internal__' has no attribute 'tf2'

Hi, Rizal here.

I am following this topic , GitHub - AntonMu/TrainYourOwnYOLO: Train a state-of-the-art yolov3 object detector from scratch!

but when i do the training, i got the error
2021-06-03 17:39:14.545998: I tensorflow/stream_executor/platform/default/] Successfully opened dynamic library
Using TensorFlow backend.
Traceback (most recent call last):
File “”, line 28, in
import keras.backend as K
File “/home/rizal/.local/lib/python3.8/site-packages/keras/”, line 12, in
from . import initializers
File “/home/rizal/.local/lib/python3.8/site-packages/keras/initializers/”, line 126, in
File “/home/rizal/.local/lib/python3.8/site-packages/keras/initializers/”, line 51, in populate_deserializable_objects
LOCAL.GENERATED_WITH_V2 = tf.internal.tf2.enabled()
AttributeError: module ‘tensorflow.compat.v2.internal’ has no attribute ‘tf2’

Any hint, for me to move forward ? Many thanks in advanded. guys.

1 Like

@Ahmad_Rizal , This stackoverflow answer may help you.

1 Like

Thank for the link, i will try it out. :smiling_face_with_three_hearts: