Unable to train mask rcnn upon the pet dataset
System information
- What is the top-level directory of the model you are using: 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): MacBook Pro
- TensorFlow installed from (source or binary):binary
- TensorFlow version (use command below):1.8
- Bazel version (if compiling from source):
- CUDA/cuDNN version: No
- GPU model and memory: CPU. 8GB ram
- Exact command to reproduce:
Im trying to train the mask rcnn .
When Im trying to train after generating tf records, Im getting the following error,
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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]]
Caused by op 'Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert', defined at: File "object_detection/train.py", line 167, in
tf.app.run() File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run _sys.exit(main(argv)) File "object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 275, in train clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue]) File "/Users/rocky/Documents/research/models/research/slim/deployment/model_deploy.py", line 193, in create_clones outputs = model_fn(*args, **kwargs) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 200, in _create_losses losses_dict = detection_model.loss(prediction_dict, true_image_shapes) File "/Users/rocky/Documents/research/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1608, in loss groundtruth_masks_list, File "/Users/rocky/Documents/research/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1851, in _loss_box_classifier groundtruth_boxlists, groundtruth_masks_list) File "/Users/rocky/Documents/research/models/research/object_detection/core/target_assigner.py", line 447, in batch_assign_targets anchors, gt_boxes, gt_class_targets, gt_weights) File "/Users/rocky/Documents/research/models/research/object_detection/core/target_assigner.py", line 151, in assign groundtruth_boxes.get())[:1]) File "/Users/rocky/Documents/research/models/research/object_detection/utils/shape_utils.py", line 279, in assert_shape_equal return tf.assert_equal(shape_a, shape_b) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/check_ops.py", line 405, in assert_equal return control_flow_ops.Assert(condition, data, summarize=summarize) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py", line 118, in wrapped return _add_should_use_warning(fn(*args, **kwargs)) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 172, in Assert return gen_logging_ops._assert(condition, data, summarize, name="Assert") File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 51, in _assert name=name) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op op_def=op_def) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]] Traceback (most recent call last): File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1322, in _do_call return fn(*args) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1307, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun run_metadata) 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 297, in stop_on_exception yield File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 495, in run self.run_loop() File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 1030, in run_loop self._sv.global_step]) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run run_metadata_ptr) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]]
Caused by op 'Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert', defined at: File "object_detection/train.py", line 167, in
tf.app.run() File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run _sys.exit(main(argv)) File "object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 275, in train clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue]) File "/Users/rocky/Documents/research/models/research/slim/deployment/model_deploy.py", line 193, in create_clones outputs = model_fn(*args, **kwargs) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 200, in _create_losses losses_dict = detection_model.loss(prediction_dict, true_image_shapes) File "/Users/rocky/Documents/research/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1608, in loss groundtruth_masks_list, File "/Users/rocky/Documents/research/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1851, in _loss_box_classifier groundtruth_boxlists, groundtruth_masks_list) File "/Users/rocky/Documents/research/models/research/object_detection/core/target_assigner.py", line 447, in batch_assign_targets anchors, gt_boxes, gt_class_targets, gt_weights) File "/Users/rocky/Documents/research/models/research/object_detection/core/target_assigner.py", line 151, in assign groundtruth_boxes.get())[:1]) File "/Users/rocky/Documents/research/models/research/object_detection/utils/shape_utils.py", line 279, in assert_shape_equal return tf.assert_equal(shape_a, shape_b) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/check_ops.py", line 405, in assert_equal return control_flow_ops.Assert(condition, data, summarize=summarize) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py", line 118, in wrapped return _add_should_use_warning(fn(*args, **kwargs)) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 172, in Assert return gen_logging_ops._assert(condition, data, summarize, name="Assert") File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 51, in _assert name=name) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op op_def=op_def) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]]
Traceback (most recent call last): File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1322, in _do_call return fn(*args) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1307, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun run_metadata) 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 990, in managed_session yield sess File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 769, in train sess, train_op, global_step, train_step_kwargs) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 487, in train_step run_metadata=run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run run_metadata_ptr) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]]
Caused by op 'Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert', defined at: File "object_detection/train.py", line 167, in
tf.app.run() File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run _sys.exit(main(argv)) File "object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 275, in train clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue]) File "/Users/rocky/Documents/research/models/research/slim/deployment/model_deploy.py", line 193, in create_clones outputs = model_fn(*args, **kwargs) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 200, in _create_losses losses_dict = detection_model.loss(prediction_dict, true_image_shapes) File "/Users/rocky/Documents/research/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1608, in loss groundtruth_masks_list, File "/Users/rocky/Documents/research/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1851, in _loss_box_classifier groundtruth_boxlists, groundtruth_masks_list) File "/Users/rocky/Documents/research/models/research/object_detection/core/target_assigner.py", line 447, in batch_assign_targets anchors, gt_boxes, gt_class_targets, gt_weights) File "/Users/rocky/Documents/research/models/research/object_detection/core/target_assigner.py", line 151, in assign groundtruth_boxes.get())[:1]) File "/Users/rocky/Documents/research/models/research/object_detection/utils/shape_utils.py", line 279, in assert_shape_equal return tf.assert_equal(shape_a, shape_b) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/check_ops.py", line 405, in assert_equal return control_flow_ops.Assert(condition, data, summarize=summarize) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py", line 118, in wrapped return _add_should_use_warning(fn(*args, **kwargs)) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 172, in Assert return gen_logging_ops._assert(condition, data, summarize, name="Assert") File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 51, in _assert name=name) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op op_def=op_def) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "object_detection/train.py", line 167, in
tf.app.run() File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run _sys.exit(main(argv)) File "object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 399, in train saver=saver) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 784, in train ignore_live_threads=ignore_live_threads) File "/anaconda3/envs/jungle/lib/python3.6/contextlib.py", line 99, in exit self.gen.throw(type, value, traceback) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 1000, in managed_session self.stop(close_summary_writer=close_summary_writer) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 828, in stop ignore_live_threads=ignore_live_threads) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 389, in join six.reraise(*self._exc_info_to_raise) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/six.py", line 693, in reraise raise value File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 297, in stop_on_exception yield File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 495, in run self.run_loop() File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/training/supervisor.py", line 1030, in run_loop self._sv.global_step]) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run run_metadata_ptr) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run run_metadata) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]] Caused by op 'Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert', defined at: File "object_detection/train.py", line 167, in
tf.app.run() File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run _sys.exit(main(argv)) File "object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 275, in train clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue]) File "/Users/rocky/Documents/research/models/research/slim/deployment/model_deploy.py", line 193, in create_clones outputs = model_fn(*args, **kwargs) File "/Users/rocky/Documents/research/models/research/object_detection/trainer.py", line 200, in _create_losses losses_dict = detection_model.loss(prediction_dict, true_image_shapes) File "/Users/rocky/Documents/research/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1608, in loss groundtruth_masks_list, File "/Users/rocky/Documents/research/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1851, in _loss_box_classifier groundtruth_boxlists, groundtruth_masks_list) File "/Users/rocky/Documents/research/models/research/object_detection/core/target_assigner.py", line 447, in batch_assign_targets anchors, gt_boxes, gt_class_targets, gt_weights) File "/Users/rocky/Documents/research/models/research/object_detection/core/target_assigner.py", line 151, in assign groundtruth_boxes.get())[:1]) File "/Users/rocky/Documents/research/models/research/object_detection/utils/shape_utils.py", line 279, in assert_shape_equal return tf.assert_equal(shape_a, shape_b) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/check_ops.py", line 405, in assert_equal return control_flow_ops.Assert(condition, data, summarize=summarize) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py", line 118, in wrapped return _add_should_use_warning(fn(*args, **kwargs)) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 172, in Assert return gen_logging_ops._assert(condition, data, summarize, name="Assert") File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 51, in _assert name=name) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op op_def=op_def) File "/anaconda3/envs/jungle/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, 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, 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, Loss/BoxClassifierLoss/assert_equal_2/Assert/Assert/data_4, Loss/RPNLoss/ones_1/packed)]]
I had this problem, I solved as follow:
The name of the TFRecords files should be pet_train/val.record. I changed it by editing the faces_only from True to False
check the line here https://github.com/tensorflow/models/blob/master/research/object_detection/dataset_tools/create_pet_tf_record.py#L49
Then, I regenerated TFRecord files by this
python object_detection/dataset_tools/create_pet_tf_record.py
--label_map_path=object_detection/data/two_label_map.pbtxt
--data_dir=`pwd` --output_dir=`pwd` --include_masks=True
Then, I got two TFRecords files with names pet_train/val.record, then I used them for training process with mask_rcnn_inception_v2_coco
Hope this helps
@Zumbalamambo I have this issue only when I use TFRecord files generated by create_pascal_tf_record.py. I don't have it when I use TFRecord files generated by create_pet_tf_record.py as I mentioned earlier. Is there any update?
@Abduoit not updates yet. I think google has deprecated tensorflow ever since Microsoft bought this github. :(
Maybe my fix in #3913 would help.
I think you need check you data. I did so and this issue is solved
@Abduoit don't manage to make it work no mask displayed, but exists in tfrecod i have line image/object/mask
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.
I don't believe the issue is fixed.
@Zumbalamambo We are checking to see if you still need help on this issue, as you are using an older version of tensorflow(1.x) which is officially considered as end of life. We recommend that you upgrade to 2.6 which is latest stable version of TF and let us know if the issue still persists in newer versions.refer link1 , link2 Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.