You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def make_get_config_arg(config_args):
def get_config_arg(name, type, default=None):
if type == bool:
s = config_args.get(name)
if not s:
return default
if s == 'True' or s == '1' or s == 'true':
return True
if s == 'False' or s == '0' or s == 'false':
return False
raise ValueError('Value of config_arg %s is not boolean' % name)
else:
return type(config_args.get(name, default))
return get_config_arg
but some demo python files directly call get_config_arg and this produces error.
In trainer/config_parser.py file:
def make_get_config_arg(config_args):
def get_config_arg(name, type, default=None):
if type == bool:
s = config_args.get(name)
if not s:
return default
if s == 'True' or s == '1' or s == 'true':
return True
if s == 'False' or s == '0' or s == 'false':
return False
raise ValueError('Value of config_arg %s is not boolean' % name)
else:
return type(config_args.get(name, default))
but some demo python files directly call get_config_arg and this produces error.
For example model_zoo/resnet/example/resnet.py
from paddle.trainer_config_helpers import *
"""
paper: https://arxiv.org/abs/1512.03385
"""
is_test = get_config_arg("is_test", bool, False)
is_predict = get_config_arg("is_predict", bool, False)
data_provider = get_config_arg("data_provider", bool, True)
layer_num = get_config_arg("layer_num", int, 50)
Could anyone explain this?
Thank you
The text was updated successfully, but these errors were encountered: