nicknochnack / TFODCourse

944 stars 919 forks source link

AttributeError: module 'tensorflow' has no attribute 'contrib' #134

Open DukeZacharia opened 1 year ago

DukeZacharia commented 1 year ago

Hello, can anyone try to help me here? This happens when i am training. although i update {tf.compat.v1.estimator} still get same error.

error: flow/models/research/object_detection/model_main_tf2.py --model_dir=Tensorflow/workspace/models/my_ssd_mobnet --pipeline_config_path=Tensorflow/workspace/models/my_ssd_mobnet/pipeline.config --num_train_steps=2000 Traceback (most recent call last): File "Tensorflow/models/research/object_detection/model_main_tf2.py", line 31, in import model_lib_v2 File "/home/duke/Macroact/myWorkspace/Tensorflow-Object-Detection/TFOD/Tensorflow/models/research/object_detection/model_lib_v2.py", line 29, in from object_detection import eval_util File "/home/duke/anaconda3/envs/tfod/lib/python3.6/site-packages/object_detection/eval_util.py", line 35, in slim = tf.contrib.slim AttributeError: module 'tensorflow' has no attribute 'contrib'

Package Version


absl-py 0.15.0 aiohttp 3.7.4.post0 angles 1.9.13 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 astor 0.8.1 astunparse 1.6.3 async-generator 1.10 async-timeout 3.0.1 attrs 21.4.0 backcall 0.2.0 bleach 4.1.0 blinker 1.4 brotlipy 0.7.0 cachetools 4.2.2 camera-calibration-parsers 1.12.0 catkin 0.8.10 certifi 2021.5.30 cffi 1.14.0 chardet 4.0.0 charset-normalizer 2.0.4 click 8.0.3 colorama 0.4.5 contextlib2 21.6.0 coverage 5.5 cryptography 3.4.7 cv-bridge 1.16.2 cycler 0.11.0 Cython 0.29.24 dataclasses 0.8 decorator 5.1.1 defusedxml 0.7.1 diagnostic-updater 1.11.0 docutils 0.18.1 entrypoints 0.4 gast 0.3.3 gencpp 0.7.0 geneus 3.0.0 genlisp 0.4.18 genmsg 0.6.0 gennodejs 2.0.2 genpy 0.6.15 google-auth 1.35.0 google-auth-oauthlib 0.4.4 google-pasta 0.2.0 grpcio 1.36.1 h5py 2.10.0 idna 3.3 idna-ssl 1.1.0 image-geometry 1.16.2 importlib-metadata 4.8.1 importlib-resources 5.4.0 ipykernel 5.5.6 ipython 7.16.3 ipython-genutils 0.2.0 ipywidgets 7.7.4 jedi 0.17.2 jeepney 0.7.1 Jinja2 3.0.3 jsonschema 3.2.0 jupyter 1.0.0 jupyter-client 7.1.2 jupyter-console 6.4.3 jupyter-core 4.9.2 jupyterlab-pygments 0.1.2 jupyterlab-widgets 1.1.3 keras 2.12.0 Keras-Preprocessing 1.1.2 keyring 23.4.1 kiwisolver 1.3.1 lxml 4.9.2 Markdown 3.3.4 MarkupSafe 2.0.1 matplotlib 3.3.4 message-filters 1.16.0 mistune 0.8.4 mkl-fft 1.3.0 mkl-random 1.1.1 mkl-service 2.3.0 multidict 5.1.0 nbclient 0.5.9 nbconvert 6.0.7 nbformat 5.1.3 nest-asyncio 1.5.6 notebook 6.4.10 numpy 1.19.2 oauthlib 3.2.0 object-detection 0.1 opt-einsum 3.3.0 packaging 21.3 pandocfilters 1.5.0 parso 0.7.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 8.4.0 pip 21.3.1 pkginfo 1.9.6 prometheus-client 0.16.0 prompt-toolkit 3.0.36 protobuf 3.17.2 ptyprocess 0.7.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycocotools 2.0.6 pycparser 2.21 Pygments 2.14.0 PyJWT 2.1.0 pyOpenSSL 21.0.0 pyparsing 2.4.7 pyrsistent 0.18.0 PySocks 1.7.1 python-dateutil 2.8.2 python-qt-binding 0.4.4 pyzmq 25.0.2 qt-dotgraph 0.4.2 qt-gui 0.4.2 qt-gui-py-common 0.4.2 qtconsole 5.2.2 QtPy 2.0.1 readme-renderer 34.0 requests 2.27.1 requests-oauthlib 1.3.0 requests-toolbelt 0.10.1 rfc3986 1.5.0 rosboost-cfg 1.15.8 rosclean 1.15.8 rosgraph 1.16.0 roslint 0.12.0 roslz4 1.16.0 rosmake 1.15.8 rosmaster 1.16.0 rosparam 1.16.0 rsa 4.7.2 sacrebleu 2.2.0 scipy 1.4.1 SecretStorage 3.3.3 Send2Trash 1.8.0 sensor-msgs 1.13.1 setuptools 59.6.0 six 1.16.0 smach 2.5.1 smclib 1.8.6 tensorboard 2.2.2 tensorboard-plugin-wit 1.6.0 tensorflow 2.2.0 tensorflow-estimator 2.2.0 tensorflow-io 0.21.0 tensorflow-object-detection-api 0.1.1 termcolor 1.1.0 terminado 0.12.1 testpath 0.6.0 tf-models-official 2.11.5 topic-tools 1.16.0 tornado 6.1 tqdm 4.64.1 traitlets 4.3.3 twine 3.8.0 typing_extensions 4.1.1 urllib3 1.26.8 versioneer 0.22 wcwidth 0.2.6 webencodings 0.5.1 Werkzeug 2.0.3 wheel 0.37.1 widgetsnbextension 3.6.3 wrapt 1.12.1 yarl 1.6.3 zipp 3.6.0

g-hano commented 1 year ago

did you solve the problem

RohitYeast commented 9 months ago

Problems like this are sometimes caused by having the wrong version of a module installed. Try using the command pip check, it will show you what module versions are required by other modules you are using. Then do pip install <module>==<required_version> Start by fixing the most important modules like tensorflow and tf-models-official