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

get_config_arg() and make_get_config_arg() in trainer/config_parser.py produces error in demo python script #2173

Closed
juliecbd opened this issue May 17, 2017 · 1 comment
Assignees

Comments

@juliecbd
Copy link

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))

return get_config_arg

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

@luotao1 luotao1 added this to 删除demo目录 in V2 API Enhancement May 17, 2017
@lcy-seso lcy-seso self-assigned this May 17, 2017
@lcy-seso
Copy link
Contributor

Thanks for your problem. I will check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
V2 API Enhancement
demo目录的问题
Development

No branches or pull requests

3 participants