Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Bugfix NeonArgparser constructor #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gabrielbriones
Copy link

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:

parser = NeonArgparser(__doc__)

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'

Signed-off-by: Gabriel Briones Sayeg <[email protected]>
@baojun-nervana
Copy link
Contributor

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

@baojun-nervana
Copy link
Contributor

@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
Copy link
Member

ashahba commented Mar 1, 2018

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 🙁

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants