K210-yolo3
K210-yolo3 copied to clipboard
AttributeError: module 'tensorflow' has no attribute 'python'
I've run python3 voc_annotation.py ./VOCdevkit
but get a following error.
Traceback (most recent call last):
File "voc_annotation.py", line 2, in <module>
import tensorflow.python as tf
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation_wrapper.py", line 106, in __getattr__
attr = getattr(self._dw_wrapped_module, name)
AttributeError: module 'tensorflow' has no attribute 'python'
After modified line 2 to import tensorflow as tf
, It's good for running.
I think that the idea is not to import tensorflow.python
directly. Those classes, objects, and submodules of python that are intended to be used by applications are made available simply by import tensorflow
.
My code test in tensorflow r1.14, maybe you should update your tensorflow.
All package:
numpy==1.16.2 tensorflow_gpu==1.14.0 opencv_python==4.0.0.21 matplotlib==3.0.3 Pillow==6.1.0
chande this line. It work for my.
#import tensorflow.python as tf import tensorflow as tf
#mport tensorflow.python.keras.backend as K import tensorflow.keras.backend as K