在C++调用python工程中
涉及到tf.app.flags无法在调用中使用
报错argv cannot be an empty list, and must contain the program name as the first element
你可以在使用flags的脚本中
import sys
print(sys.argv)
看一下argv的情况,如上报错应该是argv = []
这时你可以根据纯python运行时,再看以下argv应该是什么,然后手动添加,例如
import sys
sys.argv = ['/home/yas/ClionProjects/person_segmentation.py']