Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Rajcr2 opened this issue May 26, 2024 · 1 comment
Open

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

Rajcr2 opened this issue May 26, 2024 · 1 comment
Assignees
Labels
models:research models that come under research directory type:docs

Comments

@Rajcr2
Copy link

Rajcr2 commented May 26, 2024

Hello, I am using TFOD API for custom object detection.
While during last step of installation verification. After, Running following command -
!python object_detection/builders/model_builder_tf2_test.py

I faced following error. How to resolve this issue ?


2024-05-26 11:06:06.451631: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-05-26 11:06:06.451702: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-05-26 11:06:06.454451: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-05-26 11:06:07.882734: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "/content/drive/MyDrive/Tf_Raj/models/research/object_detection/builders/model_builder_tf2_test.py", line 24, in
from object_detection.builders import model_builder
File "/usr/local/lib/python3.10/dist-packages/object_detection/builders/model_builder.py", line 22, in
from object_detection.builders import box_predictor_builder
File "/usr/local/lib/python3.10/dist-packages/object_detection/builders/box_predictor_builder.py", line 20, in
from object_detection.predictors import convolutional_box_predictor
File "/usr/local/lib/python3.10/dist-packages/object_detection/predictors/convolutional_box_predictor.py", line 22, in
slim = tf.contrib.slim
AttributeError: module 'tensorflow' has no attribute 'contrib'
`

I am currently using Google Colab.
Tensorflow version = 2.15.0 and I followed this documentation - https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html
Pls help Thank You.

@Rajcr2 Rajcr2 added models:official models that come under official repository type:docs labels May 26, 2024
@laxmareddyp laxmareddyp added models:research models that come under research directory and removed models:official models that come under official repository labels May 28, 2024
@Sam-Seaberry
Copy link

Try:
pip install tf_slim
and change the import to:
import tf_slim as slim

tf.contrib is depreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
models:research models that come under research directory type:docs
Projects
None yet
Development

No branches or pull requests

3 participants