-
Notifications
You must be signed in to change notification settings - Fork 478
Description
hi @mpatacchiola
i try to run the head pose estimation example but it give me un error that t cant solve it i hope that you can help me:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import cv2
from deepgaze.head_pose_estimation import CnnHeadPoseEstimator
sess =tf.compat.v1.Session() #Launch the graph in a session.
my_head_pose_estimator = CnnHeadPoseEstimator(sess) #Head pose estimation object
my_head_pose_estimator.load_pitch_variables("../../etc/tensorflow/head_pose/pitch/cnn_cccdd_30k.tf")
for i in range(1,9):
file_name = str(i) + ".jpg"
print("Processing image ..... " + file_name)
image = cv2.imread(file_name) #Read the image with OpenCV
pitch = my_head_pose_estimator.return_pitch(image) #Evaluate the pitch angle using a CNN
print("Estimated pitch ..... " + str(pitch[0,0,0]))
print("")
=>AttributeError Traceback (most recent call last)
in ()
5 sess =tf.compat.v1.Session() #Launch the graph in a session.
6 my_head_pose_estimator = CnnHeadPoseEstimator(sess) #Head pose estimation object
----> 7 my_head_pose_estimator.load_pitch_variables("../../etc/tensorflow/head_pose/pitch/cnn_cccdd_30k.tf")
8 for i in range(1,9):
9 file_name = str(i) + ".jpg"
1 frames
/content/gdrive/My Drive/deepgaze/deepgaze/head_pose_estimation.py in _allocate_pitch_variables(self)
231 self._num_labels = 1
232 # Input data [batch_size, image_size, image_size, channels]
--> 233 self.tf_pitch_input_vector = tf.placeholder(tf.float32, shape=(64, 64, 3))
234
235 # Variables.
AttributeError: module 'tensorflow' has no attribute 'placeholder'
note: the version of tensorflow that i use it is:(2.3.0)
what version of tensorflow shoud i reinstall,??