svpino / tf_object_detection_cm

Confusion Matrix in Object Detection with TensorFlow
78 stars 36 forks source link

TypeError: sequence item 0: expected str instance, bytes found #7

Closed Asrix-AI closed 5 years ago

Asrix-AI commented 5 years ago

Traceback (most recent call last): File "confusion_matrix.py", line 133, in tf.app.run(main) File "/home/doe/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "confusion_matrix.py", line 128, in main confusion_matrix = process_detections(FLAGS.detections_record, categories) File "confusion_matrix.py", line 45, in process_detections decoded_dict = data_parser.parse(example) File "/home/doe/anaconda3/envs/tensorflow/models/research/object_detection/metrics/tf_example_parser.py", line 153, in parse results_dict[key] = parser.parse(tf_example) File "/home/doe/anaconda3/envs/tensorflow/models/research/object_detection/metrics/tf_example_parser.py", line 49, in parse self.field_name].HasField("bytes_list") else None TypeError: sequence item 0: expected str instance, bytes found

Asrix-AI commented 5 years ago

3903 /object_detection/inference/infer_detections.py in this script I changed 'r' to 'rb' as mentioned in and when i do

python3 confusion_matrix.py --detections_record=testing_detections.record --label_map=label_map.pbtxt as mentioned in https://github.com/svpino/tf_object_detection_cm then i got the above error. please help.

svpino commented 5 years ago

Check Issue #1 — This seems to be the same issue you are having.

Asrix-AI commented 5 years ago

Thank you so much. The problem is solved.

Asrix-AI commented 5 years ago

Can you please tell me the precision, recall values that are obtained from running this actually represents which model? What I mean is there are different models that are available in the tensorflow zoo, and I have used many models from this using the same dataset and pbtxt file. So can you please tell me how to obtain these values for different models. I got the values by following your instructions. But I want to know which model it represents. Thanks in advance.

svpino commented 5 years ago

You use a model to generate your results (detections). This script uses those detections to compute the confusion matrix. It's not tied to any model at all, but it just looks at the results you obtain from using a model.

Does that make sense?

Asrix-AI commented 5 years ago

Ok, I understood. But the mAP values will be different for different models?? also I'm asking Whether every models like SSD mobilenet, inception will have same map values and recall values? I think no. Please clear my doubt as I'm just a starter. If no, can you say the model used to get the detections to get the confusion matrix

svpino commented 5 years ago

Yes, the mAP values could be different when you run different models. Every model will potentially have different precision, recall, and mAP values.