models icon indicating copy to clipboard operation
models copied to clipboard

Could not train TFRecord pascal files with mask_rcnn ????

Open Abduoit opened this issue 8 years ago • 18 comments

System information

What is the top-level directory of the model you are using: /home/jesse/gpu-py3/models/research/object_detection Have I written custom code (NO): OS Platform and Distribution (Linux Ubuntu 16.04): TensorFlow installed from (binary[using pip3): TensorFlow version (1.6.0): Python version: (3.5.2) Bazel version (N/A): GCC/Compiler version (N/A): CUDA/cuDNN version: CUDA 9.0/ CUDDN 7 GPU model and memory: Nvidia GTX 1080/ 8GB Exact command to reproduce: python object_detection/train.py --logtostderr --pipeline_config_path=/home/jesse/gpu-py3/models/research/object_detection/samples/configs/mask_rcnn_inception_v2_coco.config --train_dir=/home/jesse/gpu-py3/models/research/object_detection/models/model/training_test/training/

I get the following error when I use TFRecord files generated by create_pascal_tf_record.py, and trying to use mask_rcnn_inception_v2_coco.config as a checkpoint.

Any help please ???

(gpu-py3) jesse@jesse-System-Product-Name:~/gpu-py3/models/research$ python object_detection/train.py     --logtostderr     --pipeline_config_path=/home/jesse/gpu-py3/models/research/object_detection/samples/configs/mask_rcnn_inception_v2_coco.config     --train_dir=/home/jesse/gpu-py3/models/research/object_detection/models/model/training_test/training/
/home/jesse/gpu-py3/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2018-06-05 16:26:15.495165: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-06-05 16:26:15.588510: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-06-05 16:26:15.588765: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1212] Found device 0 with properties: 
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.86
pciBusID: 0000:01:00.0
totalMemory: 7.92GiB freeMemory: 7.38GiB
2018-06-05 16:26:15.588777: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2018-06-05 16:26:15.737561: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3245 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
WARNING:tensorflow:From /home/jesse/gpu-py3/models/research/object_detection/trainer.py:228: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.create_global_step
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:depth of additional conv before box predictor: 0
WARNING:tensorflow:From /home/jesse/gpu-py3/models/research/object_detection/core/box_predictor.py:396: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /home/jesse/gpu-py3/models/research/object_detection/core/losses.py:316: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See tf.nn.softmax_cross_entropy_with_logits_v2.

WARNING:tensorflow:From /home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py:1856: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From /home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py:1963: get_or_create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.get_or_create_global_step
INFO:tensorflow:Summary name /clone_loss is illegal; using clone_loss instead.
/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py:98: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.
  "Converting sparse IndexedSlices to a dense Tensor of unknown shape. "
WARNING:tensorflow:From /home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/contrib/slim/python/slim/learning.py:736: Supervisor.__init__ (from tensorflow.python.training.supervisor) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.MonitoredTrainingSession
2018-06-05 16:26:22.456067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2018-06-05 16:26:22.456194: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3958 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
INFO:tensorflow:Restoring parameters from /home/jesse/gpu-py3/models/research/object_detection/models/model/mask_rcnn_inception_v2_coco_train/mask_rcnn_inception_v2_coco_2018_01_28/model.ckpt
INFO:tensorflow:Running local_init_op.
INFO:tensorflow:Done running local_init_op.
INFO:tensorflow:Starting Session.
INFO:tensorflow:Saving checkpoint to path /home/jesse/gpu-py3/models/research/object_detection/models/model/training_test/training/model.ckpt
INFO:tensorflow:Starting Queues.
INFO:tensorflow:global_step/sec: 0
2018-06-05 16:26:33.187348: W tensorflow/core/common_runtime/bfc_allocator.cc:219] Allocator (GPU_0_bfc) ran out of memory trying to allocate 3.06GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
2018-06-05 16:26:33.425259: W tensorflow/core/common_runtime/bfc_allocator.cc:219] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.55GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
2018-06-05 16:26:33.429808: W tensorflow/core/common_runtime/bfc_allocator.cc:219] Allocator (GPU_0_bfc) ran out of memory trying to allocate 3.19GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
2018-06-05 16:26:33.436913: W tensorflow/core/common_runtime/bfc_allocator.cc:219] Allocator (GPU_0_bfc) ran out of memory trying to allocate 3.06GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
2018-06-05 16:26:33.441532: W tensorflow/core/common_runtime/bfc_allocator.cc:219] Allocator (GPU_0_bfc) ran out of memory trying to allocate 3.83GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
INFO:tensorflow:Error reported to Coordinator: assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]

Caused by op 'Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert', defined at:
  File "object_detection/train.py", line 200, in <module>
    tf.app.run()
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "object_detection/train.py", line 196, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 246, in train
    clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
  File "/home/jesse/gpu-py3/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 181, in _create_losses
    losses_dict = detection_model.loss(prediction_dict, true_image_shapes)
  File "/home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1580, in loss
    groundtruth_masks_list,
  File "/home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1813, in _loss_box_classifier
    groundtruth_boxlists, groundtruth_masks_list)
  File "/home/jesse/gpu-py3/models/research/object_detection/core/target_assigner.py", line 447, in batch_assign_targets
    anchors, gt_boxes, gt_class_targets, gt_weights)
  File "/home/jesse/gpu-py3/models/research/object_detection/core/target_assigner.py", line 151, in assign
    groundtruth_boxes.get())[:1])
  File "/home/jesse/gpu-py3/models/research/object_detection/utils/shape_utils.py", line 279, in assert_shape_equal
    return tf.assert_equal(shape_a, shape_b)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/check_ops.py", line 402, in assert_equal
    return control_flow_ops.Assert(condition, data, summarize=summarize)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/util/tf_should_use.py", line 118, in wrapped
    return _add_should_use_warning(fn(*args, **kwargs))
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 169, in Assert
    return gen_logging_ops._assert(condition, data, summarize, name="Assert")
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 48, in _assert
    name=name)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3271, in create_op
    op_def=op_def)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1650, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]
Traceback (most recent call last):
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1361, in _do_call
    return fn(*args)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1340, in _run_fn
    target_list, status, run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/coordinator.py", line 297, in stop_on_exception
    yield
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/coordinator.py", line 495, in run
    self.run_loop()
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/supervisor.py", line 1030, in run_loop
    self._sv.global_step])
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 905, in run
    run_metadata_ptr)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1137, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1355, in _do_run
    options, run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1374, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]

Caused by op 'Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert', defined at:
  File "object_detection/train.py", line 200, in <module>
    tf.app.run()
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "object_detection/train.py", line 196, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 246, in train
    clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
  File "/home/jesse/gpu-py3/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 181, in _create_losses
    losses_dict = detection_model.loss(prediction_dict, true_image_shapes)
  File "/home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1580, in loss
    groundtruth_masks_list,
  File "/home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1813, in _loss_box_classifier
    groundtruth_boxlists, groundtruth_masks_list)
  File "/home/jesse/gpu-py3/models/research/object_detection/core/target_assigner.py", line 447, in batch_assign_targets
    anchors, gt_boxes, gt_class_targets, gt_weights)
  File "/home/jesse/gpu-py3/models/research/object_detection/core/target_assigner.py", line 151, in assign
    groundtruth_boxes.get())[:1])
  File "/home/jesse/gpu-py3/models/research/object_detection/utils/shape_utils.py", line 279, in assert_shape_equal
    return tf.assert_equal(shape_a, shape_b)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/check_ops.py", line 402, in assert_equal
    return control_flow_ops.Assert(condition, data, summarize=summarize)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/util/tf_should_use.py", line 118, in wrapped
    return _add_should_use_warning(fn(*args, **kwargs))
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 169, in Assert
    return gen_logging_ops._assert(condition, data, summarize, name="Assert")
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 48, in _assert
    name=name)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3271, in create_op
    op_def=op_def)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1650, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]

Traceback (most recent call last):
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1361, in _do_call
    return fn(*args)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1340, in _run_fn
    target_list, status, run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/supervisor.py", line 990, in managed_session
    yield sess
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 768, in train
    sess, train_op, global_step, train_step_kwargs)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 487, in train_step
    run_metadata=run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 905, in run
    run_metadata_ptr)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1137, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1355, in _do_run
    options, run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1374, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]

Caused by op 'Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert', defined at:
  File "object_detection/train.py", line 200, in <module>
    tf.app.run()
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "object_detection/train.py", line 196, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 246, in train
    clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
  File "/home/jesse/gpu-py3/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 181, in _create_losses
    losses_dict = detection_model.loss(prediction_dict, true_image_shapes)
  File "/home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1580, in loss
    groundtruth_masks_list,
  File "/home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1813, in _loss_box_classifier
    groundtruth_boxlists, groundtruth_masks_list)
  File "/home/jesse/gpu-py3/models/research/object_detection/core/target_assigner.py", line 447, in batch_assign_targets
    anchors, gt_boxes, gt_class_targets, gt_weights)
  File "/home/jesse/gpu-py3/models/research/object_detection/core/target_assigner.py", line 151, in assign
    groundtruth_boxes.get())[:1])
  File "/home/jesse/gpu-py3/models/research/object_detection/utils/shape_utils.py", line 279, in assert_shape_equal
    return tf.assert_equal(shape_a, shape_b)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/check_ops.py", line 402, in assert_equal
    return control_flow_ops.Assert(condition, data, summarize=summarize)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/util/tf_should_use.py", line 118, in wrapped
    return _add_should_use_warning(fn(*args, **kwargs))
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 169, in Assert
    return gen_logging_ops._assert(condition, data, summarize, name="Assert")
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 48, in _assert
    name=name)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3271, in create_op
    op_def=op_def)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1650, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "object_detection/train.py", line 200, in <module>
    tf.app.run()
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "object_detection/train.py", line 196, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 370, in train
    saver=saver)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 783, in train
    ignore_live_threads=ignore_live_threads)
  File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/supervisor.py", line 1000, in managed_session
    self.stop(close_summary_writer=close_summary_writer)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/supervisor.py", line 828, in stop
    ignore_live_threads=ignore_live_threads)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/coordinator.py", line 389, in join
    six.reraise(*self._exc_info_to_raise)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/six.py", line 693, in reraise
    raise value
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/coordinator.py", line 297, in stop_on_exception
    yield
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/coordinator.py", line 495, in run
    self.run_loop()
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/training/supervisor.py", line 1030, in run_loop
    self._sv.global_step])
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 905, in run
    run_metadata_ptr)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1137, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1355, in _do_run
    options, run_metadata)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1374, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]

Caused by op 'Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert', defined at:
  File "object_detection/train.py", line 200, in <module>
    tf.app.run()
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "object_detection/train.py", line 196, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 246, in train
    clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
  File "/home/jesse/gpu-py3/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "/home/jesse/gpu-py3/models/research/object_detection/trainer.py", line 181, in _create_losses
    losses_dict = detection_model.loss(prediction_dict, true_image_shapes)
  File "/home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1580, in loss
    groundtruth_masks_list,
  File "/home/jesse/gpu-py3/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1813, in _loss_box_classifier
    groundtruth_boxlists, groundtruth_masks_list)
  File "/home/jesse/gpu-py3/models/research/object_detection/core/target_assigner.py", line 447, in batch_assign_targets
    anchors, gt_boxes, gt_class_targets, gt_weights)
  File "/home/jesse/gpu-py3/models/research/object_detection/core/target_assigner.py", line 151, in assign
    groundtruth_boxes.get())[:1])
  File "/home/jesse/gpu-py3/models/research/object_detection/utils/shape_utils.py", line 279, in assert_shape_equal
    return tf.assert_equal(shape_a, shape_b)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/check_ops.py", line 402, in assert_equal
    return control_flow_ops.Assert(condition, data, summarize=summarize)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/util/tf_should_use.py", line 118, in wrapped
    return _add_should_use_warning(fn(*args, **kwargs))
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 169, in Assert
    return gen_logging_ops._assert(condition, data, summarize, name="Assert")
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 48, in _assert
    name=name)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3271, in create_op
    op_def=op_def)
  File "/home/jesse/gpu-py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1650, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): assertion failed: [] [Condition x == y did not hold element-wise:] [x (Loss/BoxClassifierLoss/assert_equal_2/x:0) = ] [0] [y (Loss/BoxClassifierLoss/assert_equal_2/y:0) = ] [1]
	 [[Node: Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert = Assert[T=[DT_STRING, DT_STRING, DT_STRING, DT_INT32, DT_STRING, DT_INT32], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Loss/BoxClassifierLoss/assert_equal_2/All/_127, Loss/RPNLoss/assert_equal/Assert/Assert/data_0, Loss/RPNLoss/assert_equal/Assert/Assert/data_1, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_2, Loss/BoxClassifierLoss/assert_equal_2/x/_129, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed/_131)]]

`

Abduoit avatar Jun 05 '18 23:06 Abduoit

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using

tensorflowbutler avatar Jun 06 '18 06:06 tensorflowbutler

@tensorflowbutler updated/ if you need more info. please let me know

Abduoit avatar Jun 06 '18 13:06 Abduoit

Can you include the commands you used to create the dataset you are using?

karmel avatar Jun 06 '18 20:06 karmel

@karmel I use these two codes for generating TFRecords files

python object_detection/dataset_tools/create_pascal_tf_record.py --label_map_path=object_detection/data/pascal_label_map.pbtxt --data_dir=object_detection/VOCdevkit --year=VOC2012 --set=train --output_path=/home/jesse/gpu-py3/models/research/ttt/pascal_train.record

python object_detection/dataset_tools/create_pascal_tf_record.py --label_map_path=object_detection/data/pascal_label_map.pbtxt --data_dir=object_detection/VOCdevkit --year=VOC2012 --set=val --output_path=/home/jesse/gpu-py3/models/research/ttt/pascal_val.record

Abduoit avatar Jun 06 '18 20:06 Abduoit

@pkulzc Looks like some sort of shape/data mismatch. Can you take a look?

karmel avatar Jun 06 '18 20:06 karmel

same error on Ubuntu 18.04

erdag avatar Jun 11 '18 04:06 erdag

Sorry for the delay, I'll look into this.

pkulzc avatar Jun 11 '18 06:06 pkulzc

Try to create the tf.record files by using the skript for the deeplab model, since the one for object detection doesn´t include mask data: https://github.com/tensorflow/models/blob/master/research/deeplab/datasets/download_and_convert_voc2012.sh

MrYoungblood avatar Jun 13 '18 11:06 MrYoungblood

@MrYoungblood I tried to use it, it generates several train.tfrecord/val.tfrecord . I am wondering if I can use them for training.

Abduoit avatar Jun 13 '18 14:06 Abduoit

@Abduoit So far I am using "pascal_voc_seg/tfrecord/train*.tfrecord" and "pascal_voc_seg/tfrecord/val*.tfrecord" in the config file to read all the files. However, I am also in the process of trying it and checking if all files are used.

MrYoungblood avatar Jun 13 '18 15:06 MrYoungblood

@MrYoungblood have you ever successfully trained your dataset with mask model? I also tried to use pet_create_tf but I got bad results, you can check my question HERE

Abduoit avatar Jun 13 '18 17:06 Abduoit

@Abduoit Hello...Have you solved this InvalidArgumentError (see above for traceback): assertion failed: [] [ ... ] ? Can you give me an advice?

SpiralBeing avatar Jul 01 '18 17:07 SpiralBeing

@FreedoomFighter no not yet

Abduoit avatar Jul 01 '18 17:07 Abduoit

@Abduoit I know you mistake (probably it will help you). Check https://stackoverflow.com/questions/50662105/tensorflow-training-and-evaluation-process/51129147#51129147 (Change line: batch_size: 1. Number here means amount of images which are trained in one iteration.)

SpiralBeing avatar Jul 02 '18 04:07 SpiralBeing

@Abduoit I think you have to change the tfrecord file completly and create it on your own, since for object detection there are several inputs necessary which are not given by the creation of the tfrecord files from deeplab.

MrYoungblood avatar Jul 03 '18 12:07 MrYoungblood

i tried too the pet_create_tf but no mask is displayed.. any idea ?

leccyril avatar Jul 13 '18 13:07 leccyril

I now trained the Pascal Voc dataset using mask RCNN. However, I think the evaluation results are quite bad when comparing them e.g. with DeepLab. A strange beahaviour is also that e.g. for the category "boat" the detection/segmentation gets worse with more training steps.

losses map boat1 boat2

MrYoungblood avatar Aug 13 '18 15:08 MrYoungblood

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