I am trying to train my own Dataset on model using lstm_object_detection network.
I have created tfrecords for the same.
While running train.py from lstm_object_detection, i am getting following error:
Traceback (most recent call last):
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 558, in make_tensor_proto
str_values = [compat.as_bytes(x) for x in proto_values]
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 558, in
str_values = [compat.as_bytes(x) for x in proto_values]
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/util/compat.py", line 61, in as_bytes
(bytes_or_text,))
TypeError: Expected binary or unicode string, gotDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "lstm_object_detection/train.py", line 185, in
tf.app.run()
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "lstm_object_detection/train.py", line 181, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "/home/kt-ml1/models-master/models-master/research/lstm_object_detection/trainer.py", line 293, in train
clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
File "/home/kt-ml1/models-master/models-master/research/slim/deployment/model_deploy.py", line 193, in create_clones
outputs = model_fn(args, *kwargs)
File "/home/kt-ml1/models-master/models-master/research/lstm_object_detection/trainer.py", line 174, in _create_losses
losses_dict = detection_model.loss(prediction_dict, true_image_shapes)
File "/home/kt-ml1/models-master/models-master/research/lstm_object_detection/meta_architectures/lstm_ssd_meta_arch.py", line 165, in loss
match_list = [matcher.Match(match) for match in tf.unstack(batch_match)]
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1149, in unstack
value = ops.convert_to_tensor(value)
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1039, in convert_to_tensor
return convert_to_tensor_v2(value, dtype, preferred_dtype, name)
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1097, in convert_to_tensor_v2
as_ref=False)
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1175, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 304, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 245, in constant
allow_broadcast=True)
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 283, in _constant_impl
allow_broadcast=allow_broadcast))
File "/home/kt-ml1/.local/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 562, in make_tensor_proto
"supported type." % (type(values), values))
TypeError: Failed to convert object of typeto Tensor. Contents: [ , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ]. Consider casting elements to a supported type.
Any help solving this issue would be appreciated!
Thanks.
I have encountered the same problem, and I solved it.
Modify lstm_ssd_meta_arch.py line 165
# match_list = [matcher.Match(match) for match in tf.unstack(batch_match)]
match_list = batch_match
I have encountered the same problem, and I solved it.
Modify lstm_ssd_meta_arch.py line 165
# match_list = [matcher.Match(match) for match in tf.unstack(batch_match)]
match_list = batch_match
Done. Thanks.
But, this got me into another error as below-
tensorflow.python.framework.errors_impl.InvalidArgumentError: Name: , Feature list 'image/encoded' is required but could not be found. Did you mean to include it in feature_list_dense_missing_assumed_empty or feature_list_dense_defaults?
[[{{node ParseSingleSequenceExample/ParseSingleSequenceExample}}]]If you have solved this error, do help.
Thanks again!
I have encountered the same problem, and I solved it.
Modify lstm_ssd_meta_arch.py line 165
# match_list = [matcher.Match(match) for match in tf.unstack(batch_match)]
match_list = batch_matchDone. Thanks.
But, this got me into another error as below-tensorflow.python.framework.errors_impl.InvalidArgumentError: Name: , Feature list 'image/encoded' is required but could not be found. Did you mean to include it in feature_list_dense_missing_assumed_empty or feature_list_dense_defaults?
[[{{node ParseSingleSequenceExample/ParseSingleSequenceExample}}]]If you have solved this error, do help.
Thanks again!
Sorry, I got the same error.
I think this is caused by incorrect input. I am solving this problem.
If you have new progress, please help me.
Thanks.
Hi @lyj96 @Aaronreb,
Have you solved the feature list not found error?
I looked through the code, and noticed the only difference between tfrecord used in here and in detection API and here might be a key named 'bbox/label/index' (see tf_sequence_example_decode.py). It is used to generate class label. it can be changed in generating the tfrecord (it seems this field corresponds to image/object/class/label' in detection API ).
However the error suggests the field 'image/encode' is not found. This should only happen when it cannot find image/encode as feature list in tfrecord. This field should contains the encoded image string which is also included in generating tfrecord for object detection api.
Im still trying to find out why it cannot find the image/encode key from the tfrecord used in obj API. Though in 'tf_sequence_example_decoder.py', it create a SequnceExample for test, and the code passed the test without error.
If you got any progress, please share :)
Most helpful comment
I have encountered the same problem, and I solved it.
Modify lstm_ssd_meta_arch.py line 165
# match_list = [matcher.Match(match) for match in tf.unstack(batch_match)]match_list = batch_match