From 38b0b438b7cff282a61b6ef628c8bb3c6b9a65e7 Mon Sep 17 00:00:00 2001 From: zhudefa <18502408950@163.com> Date: Tue, 10 Apr 2018 11:24:14 +0800 Subject: [PATCH] rewrite line 251 parser.add_argument('--random_flip', default=True, type=bool, help='if horizontally flip images when training') as new script's line 252 parser.add_argument('--random_flip', default=True, type=lambda x:bool(strtobool(x)), help='if horizontally flip images when training') let it be available to set bool option in .sh --- train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index 3f99e629..49b4b5f3 100644 --- a/train.py +++ b/train.py @@ -1,6 +1,7 @@ # System libs import os import time +from distutils.util import strtobool # import math import random import argparse @@ -248,7 +249,7 @@ def main(args): help='maxmimum downsampling rate of the network') parser.add_argument('--segm_downsampling_rate', default=8, type=int, help='downsampling rate of the segmentation label') - parser.add_argument('--random_flip', default=True, type=bool, + parser.add_argument('--random_flip', default=True, type=lambda x: bool(strtobool(x)), help='if horizontally flip images when training') # Misc arguments