Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

命令行参数解析写的不对,导致无法关闭 enable_onnx_checker #989

Open
Zeco-01 opened this issue Aug 23, 2023 · 0 comments
Open

Comments

@Zeco-01
Copy link

Zeco-01 commented Aug 23, 2023

parser.add_argument(
"--enable_onnx_checker",
"-oc",
default=True,
help="Turn on onnx model checker")

此处 enable_onnx_checker 没有指定类型,在命令行中传入时,默认是 str 类型,即使设置 --enable_onnx_check=False, 最后得到的参数值不是 bool 类型的 False,而是字符串类型的 'False',在进行 if 判断时会进入执行 check 的分支:

if enable_onnx_checker:
check_model(onnx_model)

其余一些类似的参数也有类似的问题,但有些为默认 False 所以不会出现上述问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant