i am learning the tensorflow object detection api.i can train model normally using the train.py script,but when i use the eval.py script to evaluate it,some wrong happend.
python eval.py --logtostderr \
--checkpoint_dir=train_log \
--eval_dir=eval_log \
--pipeline_config_path=ssd_mobilenet_v1_coco.config
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
Traceback (most recent call last):
File "eval.py", line 168, in
tf.app.run()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "eval.py", line 164, in main
FLAGS.checkpoint_dir, FLAGS.eval_dir)
File "/home/yj/tensorflow3/models/research/object_detection/evaluator.py", line 142, in evaluate
ignore_groundtruth=eval_config.ignore_groundtruth)
File "/home/yj/tensorflow3/models/research/object_detection/evaluator.py", line 61, in _extract_prediction_tensors
detections = model.postprocess(prediction_dict)
File "/home/yj/tensorflow3/models/research/object_detection/meta_architectures/ssd_meta_arch.py", line 405, in postprocess
class_predictions_without_background)
File "/home/yj/tensorflow3/models/research/object_detection/builders/post_processing_builder.py", line 94, in score_converter_fn
scaled_logits = tf.divide(logits, logit_scale, name='scale_logits')
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/math_ops.py", line 309, in divide
return DivideDelegateWithName(x, name) / y
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/math_ops.py", line 294, in __truediv__
return _truediv_python3(self.x, y, self.name)
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/math_ops.py", line 981, in _truediv_python3
(x_dtype, y_dtype))
TypeError: x and y must have the same dtype, got tf.float32 != tf.int32
my tf version is 1.4.0,python3.4,cpu,thanks
Can you print the value of logit_scale ... it seems like it may be integer.
I have solved it, because I changed python version to 3.5.but I still don't know the reason.thank you all the same.
@aselle I'm also having the issue (with python 3.6).
logit_scale is 1 (type int)
@jimo123 you saved my day...
@marcbelmont change python to 3.5
Closing as this is resolved
Running with Python 3.5 does not work because it causes conflicts with other packages. Is there any other way around this error?
@jimo123 @Kishwar Are you able to send me the conda or virtual env you are working in?
This can be solved by this post: https://stackoverflow.com/questions/56544619/how-to-fix-typeerror-x-and-y-must-have-the-same-dtype-got-tf-uint8-tf-floa
Most helpful comment
Can you print the value of logit_scale ... it seems like it may be integer.