NervanaSystems / neon

Intel® Nervana™ reference deep learning framework committed to best performance on all hardware
http://neon.nervanasys.com/docs/latest
Apache License 2.0
3.87k stars 811 forks source link

Bugfix NeonArgparser constructor #442

Open gabrielbriones opened 6 years ago

gabrielbriones commented 6 years ago

Signed-off-by: Gabriel Briones Sayeg gabriel.briones.sayeg@intel.com

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'
baojun-nervana commented 6 years ago

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

baojun-nervana commented 6 years ago

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

ashahba commented 6 years ago

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 🙁