parser.add_argument 中 nargs 用法

代码中有:

parser.add_argument('-crop_size', help='Set the crop_size', default=[128, 128], nargs='+', type=int)


在命令行运行时,输入两个数字,以空格隔开就好

sh xxx.sh -crop_size 128 128

 

 


原文链接:https://blog.csdn.net/life_86/article/details/109083919

posted @ 2022-04-26 19:42  Tomorrow1126  阅读(407)  评论(0编辑  收藏  举报