ValueError: Tensor conversion requested dtype string for Tensor with dtype float32: 'Tensor("arg0:0", shape=(), dtype=float32)'
Please go to Stack Overflow for help and support:
http://stackoverflow.com/questions/tagged/tensorflow
Also, please understand that many of the models included in this repository are experimental and research-style code. If you open a GitHub issue, here is our policy:
- It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
- The form below must be filled out.
Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.
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): yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
- TensorFlow installed from (source or binary): N/A
- TensorFlow version (use command below): 1.7.0
- Bazel version (if compiling from source):
- CUDA/cuDNN version: 7.0.4
- GPU model and memory: N/A
- Exact command to reproduce: python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
Describe the problem
when i try to train a model using my own tfrecords, i get the following error: ValueError: Tensor conversion requested dtype string for Tensor with dtype float32: 'Tensor("arg0:0", shape=(), dtype=float32)'
i read that it is a problem with the path to the tfrecords in the config file. i use the faster_rcnn_inception_v2_pets.config file and the paths look like this:
Source code / logs
train_input_reader: { tf_record_input_reader { input_path:"/home/robotix/models/research/object_detection/train.record-?????-of-00086" } label_map_path:"/home/robotix/models/research/object_detection/training/labelmap.pbtxt" }
eval_config: {
metrics_set: "coco_detection_metrics"
num_examples:41
}
eval_input_reader: { tf_record_input_reader { input_path:"/home/robotix/models/research/object_detection/test.record-?????-of-00041" } label_map_path:"/home/robotix/models/research/object_detection/training/labelmap.pbtxt" shuffle: false num_readers: 1 }
i do not understand why i am getting that error, because it seems that the paths are correct. can anyone please advise? thank you
This is almost certainly the path error within your config file. Check again if your input_path for tfrecord files are correct or not, for example did you miss a 0 in ?????-of-00086?
This is almost certainly the path error within your config file. Check again if your
input_pathfor tfrecord files are correct or not, for example did you miss a 0 in?????-of-00086?
thank you! my problem was indeed the tfrecord file names didn't match the path i wrote in the config. the path was : input_path:"/home/robotix/models/research/object_detection/train.record-?????-of-00041" and the file names were : train.record-00000-00159 train.record-00001-00159 .... when the file names should be: train.record-00000-of-00159 train.record-00001-of-00159 .....
Closing this issue since it is resolved. Feel free to reopen if have any further problems. Thanks!