Models: ImportError: No module named image.python.ops

Created on 20 Jun 2017  路  14Comments  路  Source: tensorflow/models

Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in
from object_detection.builders import model_builder
File "/home/omnisky/models/object_detection/builders/model_builder.py", line 23, in
from object_detection.builders import matcher_builder
File "/home/omnisky/models/object_detection/builders/matcher_builder.py", line 19, in
from object_detection.matchers import bipartite_matcher
File "/home/omnisky/models/object_detection/matchers/bipartite_matcher.py", line 20, in
from tensorflow.contrib.image.python.ops import image_ops
ImportError: No module named image.python.ops

awaiting response

Most helpful comment

it appears that the proper import statement for bipartite_matcher.py line 20 should be:

from tensorflow.python.ops import image_ops

this may or may not solve the entire issue, but searching the repository and browser tensorflow, that is the proper location (I think).

All 14 comments

@wuyuzaizai Which version of Tensorflow are you using? Could you try upgrading to Version 1.2.0?

@wuyuzaizai Have you got the solution of this problem ..i am facing the same problem
@derekjchow Is it related to the version of tf???

@vinodkkurmi I suspect so. Could you provide information about your setup?

Please provide details for how to reproduce this problem.

Please provide details about what platform you are using (operating system, architecture). Also include your TensorFlow version. Also, did you compile from source or install a binary? Make sure you also include the exact command if possible to produce the output included in your test case. If you are unclear what to include see the issue template displayed in the Github new issue template.

We ask for this in the issue submission template, because it is really difficult to help without that information. Thanks!

I got the exact same error. The tensorflow I installed was 0.12 using pip install tensorflow-gpu. The problem was solved when reinstall using conda install tensorflow-gpu (which 1.1.1 will be installed).

@ali01 Same error here. I installed using the object detection tutorial installation directions inside a Conda environment on a Mac OSX 10.12.5. This is with Tensorflow 1.2.1, Python 3.5.3.

I was able to run the the object detection tutorial first but now am getting this error.

The error comes when I run this step:

python object_detection/train.py \
    --logtostderr \
    --pipeline_config_path=${PATH_TO_YOUR_PIPELINE_CONFIG} \
    --train_dir=${PATH_TO_TRAIN_DIR}

Paths have obviously been modified for my machine in the actual script.

@lgallen I don't think you included the error in your comment. Could you add it?

@derekjchow Here it is:

Traceback (most recent call last):
File "object_detection/train.py", line 53, in
from object_detection.builders import model_builder
File "/Users/lgallen/anaconda/envs/mobilenets/lib/python3.5/site-packages/tensorflow/models/object_detection/builders/model_builder.py", line 23, in
from object_detection.builders import matcher_builder
File "/Users/lgallen/anaconda/envs/mobilenets/lib/python3.5/site-packages/tensorflow/models/object_detection/builders/matcher_builder.py", line 19, in
from object_detection.matchers import bipartite_matcher
File "/Users/lgallen/anaconda/envs/mobilenets/lib/python3.5/site-packages/tensorflow/models/object_detection/matchers/bipartite_matcher.py", line 20, in
from tensorflow.contrib.image.python.ops import image_ops
ImportError: No module named image.python.ops

it appears that the proper import statement for bipartite_matcher.py line 20 should be:

from tensorflow.python.ops import image_ops

this may or may not solve the entire issue, but searching the repository and browser tensorflow, that is the proper location (I think).

@rdslater This fix resolves the specific error message that was reported in this thread. Thank you.

Does this problem solved by someone? I got the same error, as before, I install tensorflow 0.8.0 and cuda 8.0, my python is 2.7.12, when I configure Google's Objection Detection model by using the guildline in website "https://github.com/tensorflow/models/blob/master/object_detection/g3doc/installation.md", and when I almost complete all the steps except the last one锛嶏紞test the installation.
when I run python object_detection/builders/model_builder_test.py, it comes the same error as your guys. Has someone know how to solve the problem? I try to Baidu, Bing (while in china cannot connect google ), no good solutions I got.

Tanx a lot. That solved the problem for me.

I was running the model_builder_test.py for Object Detection and was facing this error. @rdslater solution helped me solve the "ImportError: No module named image.python.ops" error. Thank you.

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings