slim_example_decoder.BackupHandler( AttributeError: 'module' object has no attribute 'BackupHandler
System information
- What is the top-level directory of the model you are using: /tensorflow/models/research/object_detection/
- 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): MacOS
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): 'v1.5.0-0-g37aa430d84', '1.5.0'
- Bazel version (if compiling from source):
- CUDA/cuDNN version:
- GPU model and memory: No GPU
- Exact command to reproduce:
gcloud ml-engine jobs submit training object_detection_
date +%s
--runtime-version 1.2
--job-dir=gs://agitensorflow1/models/model/train
--packages /Users/agi/downloads/tensorflow/models/research/dist/object_detection-0.1.tar.gz,/Users/agi/downloads/tensorflow/models/research/slim/dist/slim-0.1.tar.gz
--module-name object_detection.train
--region us-central1
--config /Users/agi/downloads/tensorflow/poc/config/cloud.yml
--
--train_dir=gs://agitensorflow1/models/model/train
--pipeline_config_path=gs://agitensorflow1/models/model/ssd_mobilenet_v1_poc.config
You can collect some of this information using our environment capture script:
== cat /etc/issue =============================================== Darwin MacBookAir-I.RJJADOMAIN 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64 Mac OS X 10.13.3
== are we in docker ============================================= No
== compiler ===================================================== Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin17.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
== uname -a ===================================================== Darwin MacBookAir-I.RJJADOMAIN 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
== check pips =================================================== numpy (1.14.1) protobuf (3.5.1) tensorflow (1.5.0) tensorflow-tensorboard (1.5.1)
== check for virtualenv ========================================= True
== tensorflow import ============================================
Describe the problem
When I run the training model in the cloud i receive the following error.
Source code / logs
The replica master 0 exited with a non-zero status of 1. 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 169, in
@tombstone can you please take a look?
@tombstone - Any update on this? appreciate your help. I am trying to create/train a model for identifying "guns", "weapons" for a school project, using object detection.
In my experience, pip3 install tensorflow doesn't necessarily install the latest version, so be sure to check your version and upgrade if necessary. You can check it with python3 --> import tensorflow as tf --> print(tf.__version__) but you could also just run pip3 install --upgrade tensorflow and it'll ignore it if not needed.
Also, be sure to set the PYTHONPATH environmental variables at the beginning of every time you try to go to perform these actions. You can check with env to see if it's right.
I was also experiencing this today, but performing these two actions solved this problem for me. There are other problems as well, but at least that's one down. This has been a common issue recently: #2653 and here.
@npeirson Thanks. I was able to train export the graph locally. However, when I use the jupyter notebook for object_detection_tutorial, I receive the following error,
ValueError Traceback (most recent call last)
/Users/agi/Downloads/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata) 893 try: 894 result = self._run(None, fetches, feed_dict, options_ptr, --> 895 run_metadata_ptr) 896 if run_metadata: 897 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
/Users/agi/Downloads/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata) 1102 'Cannot feed value of shape %r for Tensor %r, ' 1103 'which has shape %r' -> 1104 % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) 1105 if not self.graph.is_feedable(subfeed_t): 1106 raise ValueError('Tensor %s may not be fed.' % subfeed_t)
ValueError: Cannot feed value of shape (1, 199, 254, 3) for Tensor u'encoded_image_string_tensor:0', which has shape '(?,)'
I'm reproing this problem as well with the same error message, following the pet detector tutorial
@tombstone @derekjchow Can one of you please direct us to the solution of this ValueError issue
Same error as @agnellodcosta. Any solution so far?
@mhasnat @maxwang7 Pls check #3517, the shape error was resolved, after exporting the graph using the command given by @derekjchow. My issue was caused because I was using the wrong input_type. This command resolved my issues with the shape dimension error.
python object_detection/export_inference_graph.py
--# input_type image_tensor
--pipeline_config_path=/Users/agi/downloads/tensorflow/poc/models/model/ssd_mobilenet_v1_poc_local.config
--trained_checkpoint_prefix=/Users/agi/downloads/tensorflow/poc/models/model/train/model.ckpt-400
--output_directory=/Users/agi/downloads/tensorflow/poc/models/model/output
Following up on this...I was able to submit the training of my model in the cloud by doing the following steps
- Upgraded tensorflow -- pip install --upgrade tensorflow
- Upgraded glcoud sdk -- gcloud components update
- Removed the archived packages from /tensorflow/models/research/dist and /tensorflow/models/research/slim/dist
- Copy pycocotools folder in tensorflow/models/research/slim
- Modify setup.py in tensorflow/models/research/slim to include the Pycocotools package REQUIRED_PACKAGES = ['pycocotools>=1.0']
- Modify the setup.py in tensorflow/models/research to include tensorflow 1.5 REQUIRED_PACKAGES = ['tensorflow>=1.5','Pillow>=1.0','matplotlib>=1.0'] 6.1 Repackage the depenendcies using... --Run in cd /Users/xxx/Downloads/tensorflow/models/research python setup.py sdist (cd slim && python setup.py sdist)
- Use the runtime version 1.5 in GCloud training command
- Copy the checkpoint model.ckpt-data-... file to the cloud bucket
- Start the training (using the fine_tune_checkpoint: "gs://.../models/model/ckpt/model.ckpt" from_detection_checkpoint: false )
My Glcoud command looks like this...
gcloud ml-engine jobs submit training object_detection_1
--runtime-version 1.5
--job-dir=gs://xxx/models/model/train
--packages /Users/xxx/downloads/tensorflow/models/research/dist/object_detection-0.1.tar.gz,/Users/xxx/downloads/tensorflow/models/research/slim/dist/slim-0.1.tar.gz
--module-name object_detection.train
--region us-central1
--config /Users/xxx/downloads/tensorflow/poc/config/cloud.yml
--
--train_dir=gs://xxx/models/model/train
--pipeline_config_path=gs://xxx/models/model/ssd_mobilenet_v1_poc.config