tensorflow / models

Models and examples built with TensorFlow
Other
77.16k stars 45.75k forks source link

Object_Detection: Error #3627

Closed dfoley84-zz closed 5 years ago

dfoley84-zz commented 6 years ago

OS: Linux Mint Python: 3.5 TensorFlow version: 1.2.0

On executing train.py using following command: python3 train.py --logtostderr --pipeline_config_path=data/ssd_mobilenet_v1_pets.config --train_dir=Images/train

I am getting the following Errors

Traceback (most recent call last):
  File "train.py", line 163, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "train.py", line 159, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/david/models/research/object_detection/trainer.py", line 228, in train
    clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
  File "/home/david/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "/home/david/models/research/object_detection/trainer.py", line 167, in _create_losses
    losses_dict = detection_model.loss(prediction_dict)
  File "/home/david/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 474, in loss
    location_losses, cls_losses, prediction_dict, match_list)
  File "/home/david/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 640, in _apply_hard_mining
    match_list=match_list)
  File "/home/david/models/research/object_detection/core/losses.py", line 515, in __call__
    location_losses = tf.unstack(location_losses)
  File "/usr/local/lib/python2.7/dist-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)
pkulzc commented 6 years ago

Could you upgrade to tensorflow 1.4.0 or later and try again?

mastash3ff commented 6 years ago

From your path of execution, it looks like you are using Python2.7 and not Python3.5.

The default python on your machine may be unintentionally set to Python2.7.

onlyNata commented 6 years ago

@pkulzc tensorflow 1.4.0 get the same errors

Keshav-Aggarwal commented 6 years ago

Check the tfrecord. See if the tfrecord contains the data properly.

ymodak commented 5 years ago

Please note that Tensorflow Object Detection now requires tensorflow v 1.9 +. Please use the latest version of TensorFlow and build again. Feel free to reopen the issue if it still persists. Thanks!