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

"No module named matplotlib" when running Pets on Google Cloud tutorial #4059

Closed
AndrewHartAR opened this issue Apr 23, 2018 · 3 comments · Fixed by #4087
Closed

"No module named matplotlib" when running Pets on Google Cloud tutorial #4059

AndrewHartAR opened this issue Apr 23, 2018 · 3 comments · Fixed by #4087
Assignees

Comments

@AndrewHartAR
Copy link

I'm following the "Distributed Training on the Oxford-IIIT Pets Dataset on Google Cloud" tutorial.

Following the step of starting training, about 5 minutes later, I get this termination error from the logs:

Termination reason: Error. Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 51, in from object_detection.builders import model_builder File "/root/.local/lib/python2.7/site-packages/object_detection/builders/model_builder.py", line 29, in from object_detection.meta_architectures import ssd_meta_arch File "/root/.local/lib/python2.7/site-packages/object_detection/meta_architectures/ssd_meta_arch.py", line 32, in from object_detection.utils import visualization_utils File "/root/.local/lib/python2.7/site-packages/object_detection/utils/visualization_utils.py", line 25, in import matplotlib; matplotlib.use('Agg') # pylint: disable=multiple-statements ImportError: No module named matplotlib

After some Googling, it was suggested that I add a requirement for matplotlib to the required packages line of setup.py:
REQUIRED_PACKAGES = ['Pillow>=1.0', 'matplotlib']

This worked, until I ran into a later error.

I'm wondering if this is an error in the library (which is up to date on the master branch), an error in the tutorial perhaps caused by an update to the library or Google Cloud, or something that I did wrong.

@qlzh727
Copy link
Member

qlzh727 commented Apr 24, 2018

The overall setup guide for object detection contains the installation script for matplotlib. See https://github.com/tensorflow/models/blob/ed4e22b81db3c14f48964b56580416a6936c07b0/research/object_detection/g3doc/installation.md

@qlzh727 qlzh727 added the stat:awaiting response Waiting on input from the contributor label Apr 24, 2018
@AndrewHartAR
Copy link
Author

@qlzh727 I followed those steps - which install matplotlib locally, along with a host of other libraries. The problem, I suppose, is that matplotlib is not installed on the Cloud instance. I just ran this again, to be sure.

I am running this from a clone of the TensorFlow Models repo, rather than the TensorFlow repo, but I assume that should work fine?

@qlzh727
Copy link
Member

qlzh727 commented Apr 24, 2018

Indeed, I think the setup.py is stale and does not contain the latest update for required package. I will send a PR soon to fix the issue.

Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants