tensorflow / tensorflow/models

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

Open
#11,213 1 comment 0 reactions 1 assignee View on GitHub

@laxmareddyp is already working on this.

Since May 26, 2024.

models:research type:docs
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.