在进行运行ST-GCN Demo时遇到问题:
demo_offline调试:
python main.py demo_offline --video E:/Ruan/torch/st-gcn-master/st-gcn-master/resource/media/clean_and_jerk.mp4 --openpose E:/Ruan/openpose-master/openpose-master/build/python/openpose/Release
报如下错误:
(pytorch) E:\Ruan\torch\st-gcn-master\st-gcn-master>python main.py demo_offline --video E:/Ruan/torch/st-gcn-master/st-gcn-master/resource/media/clean_and_jerk.mp4 --openpose E:/Ruan/openpose-master/openpose-master/build/python/openpose/Release
Can not find Openpose Python API.
Traceback (most recent call last):
File "main.py", line 33, in <module>
p.start()
File "E:\Ruan\torch\st-gcn-master\st-gcn-master\processor\demo_offline.py", line 31, in start
video, data_numpy = self.pose_estimation()
TypeError: 'NoneType' object is not iterable
按照网上教程修改demo_offline文件后,报错依旧存在
本人修改如下:
def pose_estimation(self):
# load openpose python api
if self.arg.openpose is not None:
sys.path.append('{}/build/python/openpose/Release'.format(self.arg.openpose))
os.environ['PATH'] = os.environ['PATH'] + ';' + 'E:/Ruan/openpose-master/openpose-master/build/x64/Release/;' + 'E:/Ruan/openpose-master/openpose-master/build/bin;'
# sys.path.append('{}/python'.format(self.arg.openpose))
# sys.path.append('{}/build/python'.format(self.arg.openpose))
try:
# from openpose import pyopenpose as op
import pyopenpose as op
except:
print('Can not find Openpose Python API.')
return