ahmetozlu / tensorflow_object_counting_api

🚀 The TensorFlow Object Counting API is an open source framework built on top of TensorFlow and Keras that makes it easy to develop object counting systems!
https://www.youtube.com/watch?v=yT_1eKJTdfk
MIT License
1.32k stars 546 forks source link

Error while run single_image_object_counting.py #6

Closed andhana closed 5 years ago

andhana commented 6 years ago

When I run single_image_object_counting.py there is an error like this:

$ python single_image_object_counting.py Traceback (most recent call last): File "single_image_object_counting.py", line 28, in <module> result = object_counting_api.single_image_object_counting(input_video, detection_graph, category_index, is_color_recognition_enabled, fps, width, height) # targeted objects counting File "/root/tensorflow_object_counting_api/api/object_counting_api.py", line 469, in single_image_object_counting feed_dict={image_tensor: image_np_expanded}) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 900, in run run_metadata_ptr) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1058, in _run raise RuntimeError('Attempted to use a closed Session.') RuntimeError: Attempted to use a closed Session.

How to solve this?

aari1-sowmya commented 5 years ago

I am also getting the same error. Can any one when help me to solve this error?

mobileonekh commented 5 years ago

Replace with this file. It will work

https://www.dropbox.com/s/u3smzyg9alfmcbg/object_counting_api.py?dl=0

ahmetozlu commented 5 years ago

thanks @mobileonekh