argv cannot be an empty list, and must contain the program name as the first ele

论坛 期权论坛 脚本     
匿名技术用户   2021-1-17 10:55   1160   0

在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']

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP