这个类型的参数和其他的有很大区别,大家可以把他理解成一个“开关”,当我们运行程序的时候如果指定了带有action='store_true’类型的参数,那么就相当于启动这个参数所对应的功能,反之则不。
可以直接通过修改action = 'store_true'改成'store_false就可以实现对应功能。
parser.add_argument('--visualize', action='store_true', help='visualize features') # 特征图可视化
# parser.add_argument('--visualize', action='store_false', help='visualize features') # 特征图可视化 修改了store=false