Models: Object Detection API anchorwise_output config

Created on 15 Aug 2017  路  13Comments  路  Source: tensorflow/models

'anchorwise_output' config in example configs is true, I don't know why. When I try to change 'true' to 'false', the program throws error:

Traceback (most recent call last):
  File "../libs/object_detection/train.py", line 202, in <module>
    tf.app.run()
  File "py3-tensorflow/lib/python3.4/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "libs/object_detection/train.py", line 198, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "detection-workspace/libs/object_detection/trainer.py", line 192, in train
    clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
  File "detection-workspace/libs/slim/deployment/model_deploy.py", line 193, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "detection-workspace/libs/object_detection/trainer.py", line 133, in _create_losses
    losses_dict = detection_model.loss(prediction_dict)
  File "detection-workspace/libs/object_detection/meta_architectures/ssd_meta_arch.py", line 428, in loss
    location_losses, cls_losses, prediction_dict, match_list)
  File "detection-workspace/libs/object_detection/meta_architectures/ssd_meta_arch.py", line 563, in _apply_hard_mining
    match_list=match_list)
  File "libs/object_detection/core/losses.py", line 529, in __call__
    location_losses = tf.unstack(location_losses)
  File "py3-tensorflow/lib/python3.4/site-packages/tensorflow/python/ops/array_ops.py", line 971, in unstack
    (axis, -value_shape.ndims, value_shape.ndims))
ValueError: axis = 0 not in [0, 0)

It seems a bug and not been tested.

awaiting model gardener

All 13 comments

@jesu9 can you take a look?

Does anyone know how to fix this problem?

Me too have the same error

  File "/home/ubuntu/models/research/object_detection/train.py", line 167, in <module>
    tf.app.run()
  File "/home/ubuntu/.virtualenvs/cv2/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/ubuntu/models/research/object_detection/train.py", line 163, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/ubuntu/models/research/object_detection/trainer.py", line 228, in train
    clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
  File "/home/ubuntu/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "/home/ubuntu/models/research/object_detection/trainer.py", line 167, in _create_losses
    losses_dict = detection_model.loss(prediction_dict)
  File "/home/ubuntu/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 474, in loss
    location_losses, cls_losses, prediction_dict, match_list)
  File "/home/ubuntu/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 640, in _apply_hard_mining
    match_list=match_list)
  File "/home/ubuntu/models/research/object_detection/core/losses.py", line 515, in __call__
    location_losses = tf.unstack(location_losses)
  File "/home/ubuntu/.virtualenvs/cv2/local/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1023, in unstack
    (axis, -value_shape.ndims, value_shape.ndims))
ValueError: axis = 0 not in [0, 0)

you got any solution for this issue i am also having the same issue if you have please reply me

Me too having the same problem.
Traceback (most recent call last):
File "train.py", line 120, in
tf.app.run()
File "/home/dhinesh/Desktop/Tensorflow/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 124, in run
_sys.exit(main(argv))
File "train.py", line 116, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "/home/dhinesh/Desktop/DeepLearning/models/research/object_detection/trainer.py", line 228, in train
clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
File "/home/dhinesh/Desktop/DeepLearning/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
outputs = model_fn(args, *kwargs)
File "/home/dhinesh/Desktop/DeepLearning/models/research/object_detection/trainer.py", line 167, in _create_losses
losses_dict = detection_model.loss(prediction_dict)
File "/home/dhinesh/Desktop/DeepLearning/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 474, in loss
location_losses, cls_losses, prediction_dict, match_list)
File "/home/dhinesh/Desktop/DeepLearning/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 640, in _apply_hard_mining
match_list=match_list)
File "/home/dhinesh/Desktop/DeepLearning/models/research/object_detection/core/losses.py", line 515, in __call__
location_losses = tf.unstack(location_losses)
File "/home/dhinesh/Desktop/Tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 1054, in unstack
(axis, -value_shape.ndims, value_shape.ndims))
ValueError: axis = 0 not in [0, 0)

It was due to some images not encoded correctly in record files.

i created tf records again it also showing the same error

@Walid-Ahmed same tfrecord worked fine with other model (Rcnn_resnet) but with ssd_mobilenet_v1 it showing error.so i think tfrecord is encoded properly so this issue is related with something else

@HarshalGarg
My records worked fine with other configuration as well, still when I cleared the error in records, they can run now on all config

so how to fixed the problem?I met the same problem when i running this programming on a server.

Traceback (most recent call last):
File "object_detection/train.py", line 198, in
tf.app.run()
File "/home/deeplearning/virtualenv/python3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "object_detection/train.py", line 194, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "/home/deeplearning/projects/Google/tensorflow/models/research/object_detection/trainer.py", line 192, in train
clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
File "/home/deeplearning/projects/Google/tensorflow/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
outputs = model_fn(args, *kwargs)
File "/home/deeplearning/projects/Google/tensorflow/models/research/object_detection/trainer.py", line 133, in _create_losses
losses_dict = detection_model.loss(prediction_dict)
File "/home/deeplearning/projects/Google/tensorflow/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 431, in loss
location_losses, cls_losses, prediction_dict, match_list)
File "/home/deeplearning/projects/Google/tensorflow/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 565, in _apply_hard_mining
match_list=match_list)
File "/home/deeplearning/projects/Google/tensorflow/models/research/object_detection/core/losses.py", line 445, in __call__
location_losses = tf.unstack(location_losses)
File "/home/deeplearning/virtualenv/python3/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 989, in unstack
(axis, -value_shape.ndims, value_shape.ndims))
ValueError: axis = 0 not in [0, 0)

This fixed the problem for me:
https://stackoverflow.com/questions/48847365/tensorflow-object-detection-api-training-error
See response by harshal garg

@allen8r yep , i had fixed it. thanks ~

Closing as this is resolved

Was this page helpful?
0 / 5 - 0 ratings