Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Asrix-AI opened this issue Mar 20, 2019 · 7 comments
Closed

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

Asrix-AI opened this issue Mar 20, 2019 · 7 comments

Comments

@Asrix-AI
Copy link

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
Copy link
Author

#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
Copy link
Owner

svpino commented Mar 20, 2019

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

@Asrix-AI
Copy link
Author

Thank you so much. The problem is solved.

@Asrix-AI
Copy link
Author

Asrix-AI commented Mar 21, 2019

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
Copy link
Owner

svpino commented Mar 21, 2019

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
Copy link
Author

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
Copy link
Owner

svpino commented Mar 22, 2019

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

@svpino svpino closed this as completed Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants