tensorflow / tensorflow/models

Issue occures in Jupyter Notebook, but not in cmd - ModuleNotFoundError: No module named 'object_detection'

Open
#8,229 2 comments 0 reactions 1 assignee View on GitHub

@pkulzc is already working on this.

Since May 14, 2020.

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

Description

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
  • Mobile device (e.g., Pixel 4, Samsung Galaxy 10) if the issue happens on mobile device: No, it is on a laptop
  • TensorFlow installed from (source or binary): pip install tensorflow-gpu=2.0
  • TensorFlow version (use command below): unknown 2.0.0
  • Python version: Python 3.7.6
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: CUDA 10.1
  • GPU model and memory: GPU:0 with 6372 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0, compute capability: 6.1)

Please provide the entire URL of the model you are using?
https://github.com/tensorflow/models
https://github.com/tensorflow/models/tree/master/research/object_detection

Describe the current behavior
The current issue I am having is that I am trying to run the file "object_detection_tutorial.ipynb" from jupyter notebook I am doing this in order to confirm that I have properly installed everything on my computer/anaconda environment. I start up jupyter from the cmd anaconda environment and then I run the scripts, but I get the "ModuleNotFoundError: No module named 'object_detection" in the example file provided by TensorFlow in my Jupyter Notebook. However, in the cmd, I tested it and ran "python", "import object_detection" and it manages to find the module.

Describe the expected behavior
I expected jupyter notebook to be able to find the module as it can be found when I run it through my cmd. Important note: yes I am using the anaconda kernel: Python 3.7 (tensorflow)

Code to reproduce the issue

I just run the code in the "object_detection_tutorial.ipynb" file provided by TensorFlow
The issue happens on the following command in the script:
from object_detection.utils import ops as utils_ops
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as vis_util

Other info / logs

ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from object_detection.utils import ops as utils_ops
2 from object_detection.utils import label_map_util
3 from object_detection.utils import visualization_utils as vis_util

ModuleNotFoundError: No module named 'object_detection'

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.