models icon indicating copy to clipboard operation
models copied to clipboard

Error on validating model config in model_builder.py

Open balajiravichandiran opened this issue 9 years ago • 12 comments

I tried to train object detection with my own data, can run locally without any issue, i followed tutorial to deploy on Google Cloud, I always get same. All my buckets are same regional. ssd_mobilenet_cocov2.txt

Training input

{
  "scaleTier": "CUSTOM",
  "masterType": "standard_gpu",
  "workerType": "standard_gpu",
  "parameterServerType": "standard",
  "workerCount": "5",
  "parameterServerCount": "3",
  "packageUris": [
    "gs://mv_regional/train_checkpoint/packages/524cd800eacdfbca89a487dc1bb1501482b9d14481e814be2c0fbcc9a0fd031a/object_detection-0.1.tar.gz",
    "gs://mv_regional/train_checkpoint/packages/524cd800eacdfbca89a487dc1bb1501482b9d14481e814be2c0fbcc9a0fd031a/slim-0.1.tar.gz"
  ],
  "pythonModule": "object_detection.train",
  "args": [
    "--train_dir=gs://mv_regional/train_checkpoint/train",
    "--pipeline_config_path=gs://mv_regional/ssd_mobilenet_cocov2.config"
  ],
  "region": "us-central1",
  "runtimeVersion": "1.0",
  "jobDir": "gs://mv_regional/train_checkpoint/"
}

Error message 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 162, 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 198, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 194, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/trainer.py", line 159, in train detection_model = create_model_fn() File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/builders/model_builder.py", line 70, in build raise ValueError('model_config not of type model_pb2.DetectionModel.') ValueError: model_config not of type model_pb2.DetectionModel. The replica worker 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 162, 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 198, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 194, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/trainer.py", line 159, in train detection_model = create_model_fn() File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/builders/model_builder.py", line 70, in build raise ValueError('model_config not of type model_pb2.DetectionModel.') ValueError: model_config not of type model_pb2.DetectionModel. The replica worker 1 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, 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 198, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 194, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/trainer.py", line 159, in train detection_model = create_model_fn() File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/builders/model_builder.py", line 70, in build raise ValueError('model_config not of type model_pb2.DetectionModel.') ValueError: model_config not of type model_pb2.DetectionModel. The replica worker 2 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, 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 198, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 194, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/trainer.py", line 159, in train detection_model = create_model_fn() File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/builders/model_builder.py", line 70, in build raise ValueError('model_config not of type model_pb2.DetectionModel.') ValueError: model_config not of type model_pb2.DetectionModel. The replica worker 3 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, 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 198, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 194, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/trainer.py", line 159, in train detection_model = create_model_fn() File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/builders/model_builder.py", line 70, in build raise ValueError('model_config not of type model_pb2.DetectionModel.') ValueError: model_config not of type model_pb2.DetectionModel. The replica worker 4 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, 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 198, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 194, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/trainer.py", line 159, in train detection_model = create_model_fn() File "/root/.local/lib/python2.7/site-packages/object_detection/object_detection/builders/model_builder.py", line 70, in build raise ValueError('model_config not of type model_pb2.DetectionModel.') ValueError: model_config not of type model_pb2.DetectionModel. To find out more about why your job exited please check the logs: https://console.cloud.google.com/logs/viewer?project=381957343869&resource=ml_job%2Fjob_id%2Fobject_detection_1505389225&advancedFilter=resource.type%3D%22ml_job%22%0Aresource.labels.job_id%3D%22object_detection_1505389225%22

balajiravichandiran avatar Sep 14 '17 12:09 balajiravichandiran

I commented out following lines in builder/model_builder.py #if not isinstance(model_config, model_pb2.DetectionModel): #raise ValueError('model_config not of type model_pb2.DetectionModel.')

and builder/input_reader.py #if not isinstance(input_reader_config, input_reader_pb2.InputReader): #raise ValueError('input_reader_config not of type ' #'input_reader_pb2.InputReader.')

then the problem disappears and can train on cloud. I have know idea, why validate isinstance.

balajiravichandiran avatar Sep 14 '17 17:09 balajiravichandiran

@balajiravichandiran Would you please make the logs publicly viewable?

cy89 avatar Sep 14 '17 23:09 cy89

I can't export Cloud ML logs, so simulated error on my local. I also attached, object_detection package i tested, hope you can reproduce error from my package.

slim-0.1.tar.gz

log.txt object_detection-0.1.tar.gz

balajiravichandiran avatar Sep 15 '17 00:09 balajiravichandiran

@balajiravichandiran When running locally did you managed to run the evaluation script ? My one is not working

shamanez avatar Sep 15 '17 05:09 shamanez

yes, I am able to run evaluation on locally, as well as cloud. python eval.py --logtostderr
--checkpoint_dir=/your-checkpoint-dir
--eval_dir=/dir-to-save-eval
--pipeline_config_path=/your-config/pipleine.conf

balajiravichandiran avatar Sep 15 '17 05:09 balajiravichandiran

Did you use TF version 1.3 ?

shamanez avatar Sep 15 '17 06:09 shamanez

My evaluation job is not working locally. This is my screen when I run this. I did same as you said

image

shamanez avatar Sep 15 '17 06:09 shamanez

I don't have such warning. yes: tensorflow: '1.3.0' and Python 2.7.6

balajiravichandiran avatar Sep 15 '17 06:09 balajiravichandiran

I did the same. Store training logs in one folder .What has happened ?

shamanez avatar Sep 15 '17 06:09 shamanez

@tombstone or @derekjchow might have some ideas here.

Here's the contents of log.txt linked earlier in this issue:

(test)balaji@moovita:~/develop/git/tensor_cloud/test/src/object_detection-0.1$ python -m "object_detection.train" --train_dir=/media/balaji/data/tf_coco_13/train --pipeline_config_path=/media/balaji/data/tf_coco_13/ssd_mobilenet_coco17.pbtxt 
/home/balaji/develop/git/tensor_cloud/test/local/lib/python2.7/site-packages/pkg_resources.py:991: UserWarning: /home/balaji/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
  warnings.warn(msg, UserWarning)
/media/balaji/data/tf_coco_13/ssd_mobilenet_coco17.pbtxt /media/balaji/data/tf_coco_13/train
DEBUG print type of model config: <class 'object_detection.protos.model_pb2.DetectionModel'> <class 'google.protobuf.pyext.cpp_message.GeneratedProtocolMessageType'>
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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 "/home/balaji/develop/git/tensor_cloud/test/src/object_detection-0.1/object_detection/train.py", line 199, in <module>
    tf.app.run()
  File "/home/balaji/develop/git/tensor_cloud/test/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/balaji/develop/git/tensor_cloud/test/src/object_detection-0.1/object_detection/train.py", line 195, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "object_detection/object_detection/trainer.py", line 159, in train
    detection_model = create_model_fn()
  File "object_detection/object_detection/builders/model_builder.py", line 73, in build
    raise ValueError('model_config not of type model_pb2.DetectionModel.')
ValueError: model_config not of type model_pb2.DetectionModel.
(test)balaji@moovita:~/develop/git/tensor_cloud/test/src/object_detection-0.1$ 

tatatodd avatar Oct 11 '17 07:10 tatatodd

In my computer,I did these and fixed this problem in model_builder.py don't use "from protos import model_pb2" use "from object_detection.protos import model_pb2" instead

OliverSeth avatar Aug 21 '19 02:08 OliverSeth

Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

tensorflowbutler avatar Jan 29 '20 23:01 tensorflowbutler