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/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
Using TensorFlow backend.
Traceback (most recent call last):
File “Train_YOLO.py”, line 28, in
import keras.backend as K
File “/home/rizal/.local/lib/python3.8/site-packages/keras/init.py”, line 12, in
from . import initializers
File “/home/rizal/.local/lib/python3.8/site-packages/keras/initializers/init.py”, line 126, in
populate_deserializable_objects()
File “/home/rizal/.local/lib/python3.8/site-packages/keras/initializers/init.py”, 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.
Cheers.

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:

2 Likes