Python Forum
Using .pb saved model for object detection - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Using .pb saved model for object detection (/thread-37875.html)



Using .pb saved model for object detection - hobbyist - Aug-01-2022

I am using this guy's code: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/auto_examples/plot_object_detection_saved_model.html in order to make object detection using images and a saved .pb model. I cannot post the code from this website because it is copyrighted. The code I am using is under the paragraph: Putting everything together. I face an error on this line:

Error:
Running inference for ('workspace/training_demo/images/test_images/', [], ['image_1.jpg', 'image_2.jpg'])... Traceback (most recent call last): File "/home/someone/.local/lib/python3.9/site-packages/PIL/Image.py", line 2957, in open fp.seek(0) AttributeError: 'tuple' object has no attribute 'seek' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/someone/Desktop/TensorFlow/final_code.py", line 30, in <module> image_np = load_image_into_numpy_array(image_path) File "/home/someone/Desktop/TensorFlow/final_code.py", line 23, in load_image_into_numpy_array return np.array(Image.open(path)) File "/home/someone/.local/lib/python3.9/site-packages/PIL/Image.py", line 2959, in open fp = io.BytesIO(fp.read()) AttributeError: 'tuple' object has no attribute 'read'
I searched on google/stackoverflow and I found this candidate solution: https://stackoverflow.com/questions/20713981/python-attributeerror-tuple-object-has-no-attribute-read which didn't help.... Any ideas?


RE: Using .pb saved model for object detection - hobbyist - Aug-01-2022

Someone???


RE: Using .pb saved model for object detection - hobbyist - Aug-03-2022

Can a moderator move this thread under: " General Coding Help" since it is general python3 problem...?