tensorflow / tensorflow/models
Unable to install tensorflow object detection API on windows 10
@tombstone is already working on this.
Since Nov 8, 2021.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- I am using the latest TensorFlow Model Garden release and TensorFlow 2.
- I am reporting the issue to the correct repository. (Model Garden official or research directory)
- I checked to make sure that this issue has not been filed already.
1. The entire URL of the file you are using
https://github.com/tensorflow/models/tree/master/official/...
2. Describe the bug
A clear and concise description of what the bug is.
While trying to check if object-detection-api installation is succesful,I tried to run the following command
python object_detection/builders/model_builder_tf2_test.py.
However it is giving me the error module tensorflow has no attribute contrib
3. Steps to reproduce
for installation of object-detection api
- First, enter: !git clone https://github.com/tensorflow/models.git
- pip install pycocotools
- Then, download Protobuf:
From the protoc releases page download the latest protoc--.zip. release (e.g. protoc-3.12.3-win64.zip for 64-bit Windows).
Extract the contents of the downloaded protoc--.zip in a directory <PATH_TO_PB> of your choice (e.g. C:\Program Files\Google Protobuf).
Open command prompt and cd to tensorflow\models\research.
Run “<PATH_TO_PB>\protoc-3.4.0-win32\bin\protoc.exe” object_detection/protos/*.proto --python_out=.
To test if this worked properly, go to the object_detection/protos folder, and make sure there are .py files.
Steps to reproduce the behavior.
4.Copy the setup.py file from tensorflow\research\object_detection\packages\tf2 to tensorflow\models\research
5.Add tensorflow/models/research ,tensorflow/models/research/slim and tensorflow/models/research/object_detection to path.
6.run python -m pip install --use-feature=2020-resolver .
7.python object_detection/builders/model_builder_tf2_test.py
4. Expected behavior
A clear and concise description of what you expected to happen.
...
[ OK ] ModelBuilderTF2Test.test_create_ssd_models_from_config
[ RUN ] ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update
INFO:tensorflow:time(main.ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update): 0.0s
I0608 18:49:13.183754 29296 test_util.py:2102] time(main.ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update): 0.0s
[ OK ] ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update
[ RUN ] ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold
INFO:tensorflow:time(main.ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold): 0.0s
I0608 18:49:13.186750 29296 test_util.py:2102] time(main.ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold): 0.0s
[ OK ] ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold
[ RUN ] ModelBuilderTF2Test.test_invalid_model_config_proto
INFO:tensorflow:time(main.ModelBuilderTF2Test.test_invalid_model_config_proto): 0.0s
I0608 18:49:13.188250 29296 test_util.py:2102] time(main.ModelBuilderTF2Test.test_invalid_model_config_proto): 0.0s
[ OK ] ModelBuilderTF2Test.test_invalid_model_config_proto
[ RUN ] ModelBuilderTF2Test.test_invalid_second_stage_batch_size
INFO:tensorflow:time(main.ModelBuilderTF2Test.test_invalid_second_stage_batch_size): 0.0s
I0608 18:49:13.190746 29296 test_util.py:2102] time(main.ModelBuilderTF2Test.test_invalid_second_stage_batch_size): 0.0s
[ OK ] ModelBuilderTF2Test.test_invalid_second_stage_batch_size
[ RUN ] ModelBuilderTF2Test.test_session
[ SKIPPED ] ModelBuilderTF2Test.test_session
[ RUN ] ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor
INFO:tensorflow:time(main.ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor): 0.0s
I0608 18:49:13.193742 29296 test_util.py:2102] time(main.ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor): 0.0s
[ OK ] ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor
[ RUN ] ModelBuilderTF2Test.test_unknown_meta_architecture
INFO:tensorflow:time(main.ModelBuilderTF2Test.test_unknown_meta_architecture): 0.0s
I0608 18:49:13.195241 29296 test_util.py:2102] time(main.ModelBuilderTF2Test.test_unknown_meta_architecture): 0.0s
[ OK ] ModelBuilderTF2Test.test_unknown_meta_architecture
[ RUN ] ModelBuilderTF2Test.test_unknown_ssd_feature_extractor
INFO:tensorflow:time(main.ModelBuilderTF2Test.test_unknown_ssd_feature_extractor): 0.0s
I0608 18:49:13.197239 29296 test_util.py:2102] time(main.ModelBuilderTF2Test.test_unknown_ssd_feature_extractor): 0.0s
[ OK ] ModelBuilderTF2Test.test_unknown_ssd_feature_extractor
Ran 24 tests in 29.980s
OK (skipped=1)
5. Additional context
Include any logs that would be helpful to diagnose the problem.
File object_detection/builders/model_builder_tf2_test.py line 25 in module from object_detection.builders import box_predictor_builder
File object_detection.builders.box_predictor_builder line 20 in module from object_detection.predictors import convolutional_box_predictor
File convolutional_box_predictor line 22 in module slim=tf.contrib.slim
Error tensorflow has no attribute contrib
6. System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- Windows 10
- Mobile device name if the issue happens on a mobile device:
- TensorFlow installed from (source or binary) : from binary via pip install
- TensorFlow version (use command below):2.6 was installed during installation of object-detection-api
- Python version:3.8.5
- Bazel version (if compiling from source): none
- GCC/Compiler version (if compiling from source): none
- CUDA/cuDNN version:no gpu
- GPU model and memory: none
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.