我试图使用tf-姿态使用tensorflow version2。
!git clone https://github.com/gsethi2409/tf-pose-estimation.git > /dev/null
%cd tf-pose-estimation
!pip3 install -r requirements.txt这是我克隆的地方。但是当我运行下面的代码时。它显示出一个错误。
!python run.py --model=mobilenet_thin --resize=432x368 --image=./images/p1.jpg回溯(最近一次调用):文件"run.py",第39行,在e= TfPoseEstimator(get_graph_path(args.model),target_size=(w,h)文件第337行)中,在init self.tensor_image = self.graph.get_tensor_by_name('TfPoseEstimator/image:0') File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py",第3902行中在"/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py",返回self.as_graph_element(name,allow_tensor=True,allow_operation=False)文件的第3726行中,在as_graph_element返回self._as_graph_element_locked(obj,allow_tensor,allow_operation)文件的第3768行,在_as_graph_element_locked“图”中,% (repr( name ),repr(Op_name)) KeyError:'TfPoseEstimator/image:0‘是指不存在的张量。图中不存在'TfPoseEstimator/image‘操作。“
发布于 2021-06-03 08:47:41
在导入tensorflow的行下的tf_pose/Parameatory.py中,添加以下行
tf.compat.v1.disable_eager_execution() 链接
https://stackoverflow.com/questions/67304944
复制相似问题