neon icon indicating copy to clipboard operation
neon copied to clipboard

Bugfix NeonArgparser constructor

Open gabrielbriones opened this issue 7 years ago • 3 comments

Signed-off-by: Gabriel Briones Sayeg [email protected]

NeonArgparser inherits from configargparse.ArgumentParser but ArgumentParser takes no positional arguments, this raises an error whenever NeonArgparser is instantiated with a positional argument.

Found this issue in most of the example scripts, here is one: https://github.com/NervanaSystems/neon/blob/a10f90546d2ddae68c3671f59ba9b513158a91f1/examples/cifar10.py#L37

This is how you reproduce:

$ python3 examples/cifar10.py 
/usr/local/lib64/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Traceback (most recent call last):
  File "examples/cifar10.py", line 37, in <module>
    parser = NeonArgparser(__doc__)
  File "/usr/local/lib/python3.6/site-packages/neon/util/argparser.py", line 80, in __init__
    super(NeonArgparser, self).__init__(*args, **kwargs)
TypeError: __init__() got multiple values for argument 'add_config_file_help'

gabrielbriones avatar Feb 21 '18 18:02 gabrielbriones

@gabrielbriones Thanks. We will validate and merge to repo.

baojun-nervana avatar Feb 23 '18 00:02 baojun-nervana

@gabrielbriones It seems it runs fine on my system. $ python examples/cifar10.py Epoch 0 [Train |████████████████████| 391/391 batches, 2.64 cost, 1.39s]

baojun-nervana avatar Feb 24 '18 08:02 baojun-nervana

Thanks @gabrielbriones I had someone reported this on StackOverflow and I responded here:

https://stackoverflow.com/questions/48837894/typeerror-init-got-multiple-values-for-keyword-argument-add-config-file/49016052#49016052

However I think you are on the right track 🙁

ashahba avatar Mar 01 '18 05:03 ashahba