models icon indicating copy to clipboard operation
models copied to clipboard

ImportError: No module named quantize.python - Training on GoogleCloud ML

Open sugadevtop opened this issue 7 years ago • 5 comments

System information

  • What is the top-level directory of the model you are using: faster_rcnn_resnet101_coco_11_06_2017
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): set PATH_TO_CONFIGURE to setup the config file
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOSX 10.14.2
  • TensorFlow installed from (source or binary): pip install tensorflow
  • TensorFlow version (use command below): 1.12.0
  • Bazel version (if compiling from source): No
  • CUDA/cuDNN version: No
  • GPU model and memory: No
  • Exact command to reproduce:

gcloud ml-engine jobs submit training whoamiobject_detectiondate +%s
--job-dir=${YOUR_GCS_BUCKET}/train
--packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz,dist/pycocotools-2.0.tar.gz
--module-name object_detection.model_main \

Describe the problem

I'm trying to follow these steps on https://cloud.google.com/blog/products/gcp/training-an-object-detector-using-cloud-machine-learning-engine to train a object detector using Google Cloud ML

Everything works fine until it says ImportError: No module named quantize.python

Source code / logs

ERROR 2018-12-29 10:28:11 +0700 master-replica-0 Traceback (most recent call last): ERROR 2018-12-29 10:28:11 +0700 master-replica-0 File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main ERROR 2018-12-29 10:28:11 +0700 master-replica-0 "main", fname, loader, pkg_name) ERROR 2018-12-29 10:28:11 +0700 master-replica-0 File "/usr/lib/python2.7/runpy.py", line 72, in _run_code ERROR 2018-12-29 10:28:11 +0700 master-replica-0 exec code in run_globals ERROR 2018-12-29 10:28:11 +0700 master-replica-0 File "/root/.local/lib/python2.7/site-packages/object_detection/model_main.py", line 26, in ERROR 2018-12-29 10:28:11 +0700 master-replica-0 from object_detection import model_lib ERROR 2018-12-29 10:28:11 +0700 master-replica-0 File "/root/.local/lib/python2.7/site-packages/object_detection/model_lib.py", line 28, in ERROR 2018-12-29 10:28:11 +0700 master-replica-0 from object_detection import exporter as exporter_lib ERROR 2018-12-29 10:28:11 +0700 master-replica-0 File "/root/.local/lib/python2.7/site-packages/object_detection/exporter.py", line 20, in ERROR 2018-12-29 10:28:11 +0700 master-replica-0 from tensorflow.contrib.quantize.python import graph_matcher ERROR 2018-12-29 10:28:11 +0700 master-replica-0 ImportError: No module named quantize.python ERROR 2018-12-29 10:28:11 +0700 master-replica-0 Command '['python', '-m', u'object_detection.model_main', '--job-dir', u'gs://street-detection-ml/train']' returned non-zero exit status 1 INFO 2018-12-29 10:28:11 +0700 master-replica-0 Module completed; cleaning up. INFO 2018-12-29 10:28:11 +0700 master-replica-0 Clean up finished. ERROR 2018-12-29 10:28:25 +0700 service The replica master 0 exited with a non-zero status of 1. ERROR 2018-12-29 10:28:25 +0700 service Traceback (most recent call last): ERROR 2018-12-29 10:28:25 +0700 service File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main ERROR 2018-12-29 10:28:25 +0700 service "main", fname, loader, pkg_name) ERROR 2018-12-29 10:28:25 +0700 service File "/usr/lib/python2.7/runpy.py", line 72, in _run_code ERROR 2018-12-29 10:28:25 +0700 service exec code in run_globals ERROR 2018-12-29 10:28:25 +0700 service File "/root/.local/lib/python2.7/site-packages/object_detection/model_main.py", line 26, in ERROR 2018-12-29 10:28:25 +0700 service from object_detection import model_lib ERROR 2018-12-29 10:28:25 +0700 service File "/root/.local/lib/python2.7/site-packages/object_detection/model_lib.py", line 28, in ERROR 2018-12-29 10:28:25 +0700 service from object_detection import exporter as exporter_lib ERROR 2018-12-29 10:28:25 +0700 service File "/root/.local/lib/python2.7/site-packages/object_detection/exporter.py", line 20, in ERROR 2018-12-29 10:28:25 +0700 service from tensorflow.contrib.quantize.python import graph_matcher ERROR 2018-12-29 10:28:25 +0700 service ImportError: No module named quantize.python ERROR 2018-12-29 10:28:25 +0700 service ERROR 2018-12-29 10:28:25 +0700 service To find out more about why your job exited please check the logs: https://console.cloud.google.com/logs/viewer?project=1035448617633&resource=ml_job%2Fjob_id%2Fhungcao_object_detection_1546053952&advancedFilter=resource.type%3D%22ml_job%22%0Aresource.labels.job_id%3D%22hungcao_object_detection_1546053952%22

sugadevtop avatar Dec 29 '18 03:12 sugadevtop

I am facing the same issue on building on GCP even though I had installed quantize python locally and giving the same as package dependency in gcloud ml-engine jobs submit command please suggest did you get any work around of this issue

siddesh13 avatar Jan 10 '19 13:01 siddesh13

Facing the same. Any solution on this issue?

Zhenyi-Liu avatar Feb 07 '19 01:02 Zhenyi-Liu

Hello everyone ! I had the same issue and adding the --runtime-version 1.12 \ fixed it. Hope this help someone else.

edouardsouan avatar Apr 04 '19 15:04 edouardsouan

image I'm facing the same issue, tip above does not help.

daisoto avatar Oct 09 '19 13:10 daisoto

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Sep 04 '22 00:09 google-ml-butler[bot]