ValueError: Tensor conversion requested dtype string for Tensor with dtype float32: 'Tensor("arg0:0", shape=(), dtype=float32, device=/device:CPU:0)' Keep getting this error. Been at this for nearly 4 hours now. Really stressed.
System information
- What is the top-level directory of the model you are using:
- 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): macOS High Sierra
- TensorFlow installed from (source or binary): pip
- TensorFlow version (use command below): 1.12
- Bazel version (if compiling from source): n/a
- CUDA/cuDNN version: n/a
- GPU model and memory: No GPU
- Exact command to reproduce:
PIPELINE_CONFIG_PATH=/Users/kraisler/Desktop/raccoon_tutorial/models/model/ssd_mobilenet_v1_pets.config
MODEL_DIR=/Users/kraisler/Desktop/raccoon_tutorial/models/model
NUM_TRAIN_STEPS=50000
SAMPLE_1_OF_N_EVAL_EXAMPLES=1
python object_detection/model_main.py
--pipeline_config_path=${PIPELINE_CONFIG_PATH}
--model_dir=${MODEL_DIR}
--num_train_steps=${NUM_TRAIN_STEPS}
--sample_1_of_n_eval_examples=$SAMPLE_1_OF_N_EVAL_EXAMPLES
--alsologtostderr
You can collect some of this information using our environment capture script:
https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
Describe the problem
I am following this tutorial: https://towardsdatascience.com/how-to-train-your-own-object-detector-with-tensorflows-object-detector-api-bec72ecfe1d9
I did everything. Protoc is installed, the object detector test tensor flow provided worked, everything. I enter the following at the research directory in the object detection API:
PIPELINE_CONFIG_PATH=/Users/kraisler/Desktop/raccoon_tutorial/models/model/ssd_mobilenet_v1_pets.config
MODEL_DIR=/Users/kraisler/Desktop/raccoon_tutorial/models/model
NUM_TRAIN_STEPS=50000
SAMPLE_1_OF_N_EVAL_EXAMPLES=1
python object_detection/model_main.py
--pipeline_config_path=${PIPELINE_CONFIG_PATH}
--model_dir=${MODEL_DIR}
--num_train_steps=${NUM_TRAIN_STEPS}
--sample_1_of_n_eval_examples=$SAMPLE_1_OF_N_EVAL_EXAMPLES
--alsologtostderr
and I get the error in the title. I have no idea what this means.
Source code / logs
OUGL-2-NW-C04-M:research kraisler$ PIPELINE_CONFIG_PATH=/Users/kraisler/Desktop/raccoon_tutorial/models/model/ssd_mobilenet_v1_pets.config OUGL-2-NW-C04-M:research kraisler$ MODEL_DIR=/Users/kraisler/Desktop/raccoon_tutorial/models/model OUGL-2-NW-C04-M:research kraisler$ NUM_TRAIN_STEPS=50000 OUGL-2-NW-C04-M:research kraisler$ SAMPLE_1_OF_N_EVAL_EXAMPLES=1 OUGL-2-NW-C04-M:research kraisler$ python object_detection/model_main.py \
--pipeline_config_path=${PIPELINE_CONFIG_PATH} \ --model_dir=${MODEL_DIR} \ --num_train_steps=${NUM_TRAIN_STEPS} \ --sample_1_of_n_eval_examples=$SAMPLE_1_OF_N_EVAL_EXAMPLES \ --alsologtostderr
/Users/kraisler/models/research/object_detection/utils/visualization_utils.py:27: UserWarning: This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called before pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time.
The backend was originally set to 'MacOSX' by the following code:
File "object_detection/model_main.py", line 26, in
import matplotlib; matplotlib.use('Agg') # pylint: disable=multiple-statements
WARNING:tensorflow:Forced number of epochs for all eval validations to be 1.
W1114 20:29:31.596975 140735970734976 tf_logging.py:125] Forced number of epochs for all eval validations to be 1.
WARNING:tensorflow:Expected number of evaluation epochs is 1, but instead encountered eval_on_train_input_config.num_epochs = 0. Overwriting num_epochs to 1.
W1114 20:29:31.597275 140735970734976 tf_logging.py:125] Expected number of evaluation epochs is 1, but instead encountered eval_on_train_input_config.num_epochs = 0. Overwriting num_epochs to 1.
WARNING:tensorflow:Estimator's model_fn (<function model_fn at 0x126e94488>) includes params argument, but params are not passed to Estimator.
W1114 20:29:31.597842 140735970734976 tf_logging.py:125] Estimator's model_fn (<function model_fn at 0x126e94488>) includes params argument, but params are not passed to Estimator.
WARNING:tensorflow:num_readers has been reduced to 0 to match input file shards.
W1114 20:29:31.619033 140735970734976 tf_logging.py:125] num_readers has been reduced to 0 to match input file shards.
WARNING:tensorflow:From /Users/kraisler/models/research/object_detection/builders/dataset_builder.py:80: parallel_interleave (from tensorflow.contrib.data.python.ops.interleave_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.experimental.parallel_interleave(...).
W1114 20:29:31.685348 140735970734976 tf_logging.py:125] From /Users/kraisler/models/research/object_detection/builders/dataset_builder.py:80: parallel_interleave (from tensorflow.contrib.data.python.ops.interleave_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.experimental.parallel_interleave(...).
Traceback (most recent call last):
File "object_detection/model_main.py", line 109, in
I just want to say I have been at this for a very very long time. I'm kind aggravated. I would greatly greatly greatly appreciate it if anyone helped me. Yes, I did search for this error and no none of the methods I found worked.
Have you checked the *.record PATH
Have you checked the *.record PATH
Where is that located? My .bash_profile folder?
I solve the same problem... check out your input config, 'coco_train.record-00095-of-00100' are not consistent with 'mscoco_train.record-00095-of-00100'
I solve the same problem... check out your input config, 'coco_train.record-00095-of-00100' are not consistent with 'mscoco_train.record-00095-of-00100'
thank a lot~~~~
The error is thrown when the path to the record files is not right. I would recommend adding the whole path to the train and test records file in the data folder in the .config file. Will definitely work and get rid of this particular error.
I ran from /research and the path tf.records is research/object_detection/data/train.records but still not working. Any help?
check out your tfrecord files in train input reader input path
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.