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 545 forks source link

Using tensorflow 2.1.0 anaconda #71

Closed SaadAhmed1122 closed 4 years ago

SaadAhmed1122 commented 4 years ago

AttributeError Traceback (most recent call last)

in 6 is_color_recognition_enabled = 0 7 ----> 8 object_counting_api.object_counting(input_video, detection_graph, category_index, is_color_recognition_enabled) ~\tensorflow_object_counting_api-master\api\object_counting_api.py in object_counting(input_video, detection_graph, category_index, is_color_recognition_enabled) 260 width = 0 261 with detection_graph.as_default(): --> 262 with tf.Session(graph=detection_graph) as sess: 263 # Definite input and output Tensors for detection_graph 264 image_tensor = detection_graph.get_tensor_by_name('image_tensor:0') AttributeError: module 'tensorflow' has no attribute 'Session'
wahyu-dwil commented 4 years ago

AttributeError Traceback (most recent call last) in 6 is_color_recognition_enabled = 0 7 ----> 8 object_counting_api.object_counting(input_video, detection_graph, category_index, is_color_recognition_enabled)

~\tensorflow_object_counting_api-master\api\object_counting_api.py in object_counting(input_video, detection_graph, category_index, is_color_recognition_enabled) 260 width = 0 261 with detection_graph.as_default(): --> 262 with tf.Session(graph=detection_graph) as sess: 263 # Definite input and output Tensors for detection_graph 264 image_tensor = detection_graph.get_tensor_by_name('image_tensor:0')

AttributeError: module 'tensorflow' has no attribute 'Session'

You can use this "tf.compat.v1.Session" --> with with tf.compat.v1.Session(graph=detection_graph)