Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django TypeError:uuu init_uuuuuuuuuuu()为关键字参数';获取了多个值;添加配置文件帮助';_Django_Python 2.7 - Fatal编程技术网

Django TypeError:uuu init_uuuuuuuuuuu()为关键字参数';获取了多个值;添加配置文件帮助';

Django TypeError:uuu init_uuuuuuuuuuu()为关键字参数';获取了多个值;添加配置文件帮助';,django,python-2.7,Django,Python 2.7,我正在尝试运行Retrieval-eval.py,但遇到以下错误: TypeError: __init__() got multiple values for keyword argument 'add_config_file_help' **class NeonArgparser(configargparse.ArgumentParser):** """ Setup the command line

我正在尝试运行Retrieval-eval.py,但遇到以下错误:

 TypeError: __init__() got multiple values for keyword argument 'add_config_file_help'                                     
**class NeonArgparser(configargparse.ArgumentParser):**
    """
    Setup the command line arg parser and parse the
    arguments in sys.arg (or from configuration file).  Use the parsed
    options to configure the logging module.*emphasized text*

    Arguments:
        desc (String) : Docstring from the calling function. This will be used
                        for the description of the command receiving the
                        arguments.
    """
    def __init__(self, *args, **kwargs):
        self._PARSED = False
        self.work_dir = os.path.join(os.path.expanduser('~'), 'nervana')
        if 'default_config_files' not in kwargs:
            kwargs['default_config_files'] = [os.path.join(self.work_dir,
                                                           'neon.cfg')]
        if 'add_config_file_help' not in kwargs:
            # turn off the auto-generated config help for config files since it
            # referenced unsettable config options like --version
            kwargs['add_config_file_help'] = False

        self.defaults = kwargs.pop('default_overrides', dict())
        super(NeonArgparser, self).__init__(*args, **kwargs)

        # ensure that default values are display via --help
        self.formatter_class = configargparse.ArgumentDefaultsHelpFormatter

        self.setup_default_args()
我正在使用get_sim_score()方法从另一个目录计算相似性分数,同时通过该方法,它会转到argparser.py,这里我得到了上面显示的错误。这是我在NeonArgparser()类中的argparser.py,我遇到了这个错误。有人能帮我解决这个错误吗

 TypeError: __init__() got multiple values for keyword argument 'add_config_file_help'                                     
**class NeonArgparser(configargparse.ArgumentParser):**
    """
    Setup the command line arg parser and parse the
    arguments in sys.arg (or from configuration file).  Use the parsed
    options to configure the logging module.*emphasized text*

    Arguments:
        desc (String) : Docstring from the calling function. This will be used
                        for the description of the command receiving the
                        arguments.
    """
    def __init__(self, *args, **kwargs):
        self._PARSED = False
        self.work_dir = os.path.join(os.path.expanduser('~'), 'nervana')
        if 'default_config_files' not in kwargs:
            kwargs['default_config_files'] = [os.path.join(self.work_dir,
                                                           'neon.cfg')]
        if 'add_config_file_help' not in kwargs:
            # turn off the auto-generated config help for config files since it
            # referenced unsettable config options like --version
            kwargs['add_config_file_help'] = False

        self.defaults = kwargs.pop('default_overrides', dict())
        super(NeonArgparser, self).__init__(*args, **kwargs)

        # ensure that default values are display via --help
        self.formatter_class = configargparse.ArgumentDefaultsHelpFormatter

        self.setup_default_args()
这是异常跟踪,请看一下

 TypeError: __init__() got multiple values for keyword argument 'add_config_file_help'                                     
**class NeonArgparser(configargparse.ArgumentParser):**
    """
    Setup the command line arg parser and parse the
    arguments in sys.arg (or from configuration file).  Use the parsed
    options to configure the logging module.*emphasized text*

    Arguments:
        desc (String) : Docstring from the calling function. This will be used
                        for the description of the command receiving the
                        arguments.
    """
    def __init__(self, *args, **kwargs):
        self._PARSED = False
        self.work_dir = os.path.join(os.path.expanduser('~'), 'nervana')
        if 'default_config_files' not in kwargs:
            kwargs['default_config_files'] = [os.path.join(self.work_dir,
                                                           'neon.cfg')]
        if 'add_config_file_help' not in kwargs:
            # turn off the auto-generated config help for config files since it
            # referenced unsettable config options like --version
            kwargs['add_config_file_help'] = False

        self.defaults = kwargs.pop('default_overrides', dict())
        super(NeonArgparser, self).__init__(*args, **kwargs)

        # ensure that default values are display via --help
        self.formatter_class = configargparse.ArgumentDefaultsHelpFormatter

        self.setup_default_args()
    (ronin) pratyusha@pratyusha-Q304UAK:~/Projects/ronin$ python Retrieval-Eval.py
No handlers could be found for logger "gensim.models.doc2vec"
<IPython.core.display.HTML object>
Can you suggest a spa for us?
Are transport facilities available here?
Traceback (most recent call last):
  File "Retrieval-Eval.py", line 484, in <module>
    e = evaluate(dialogue, dtype="str", concept_weight=1.0, task_weight=0)
  File "Retrieval-Eval.py", line 248, in evaluate
    retrieval2 = get_skipsim_matches(selected=questions, dtype="str", conceptW=concept_weight, taskW=task_weight)  #HERE !!!!!!!!!!!!!
  File "Retrieval-Eval.py", line 446, in get_skipsim_matches
    conceptDictionary = get_skipsim_concept_dictionary(selected[1:], dtype)   
  File "Retrieval-Eval.py", line 464, in get_skipsim_concept_dictionary
    scores = get_list_skipsim_scores(selected, dialogue, dtype)   
  File "Retrieval-Eval.py", line 430, in get_list_skipsim_scores
    score = st.get_sim_score(q1, q2)    
  File "/home/pratyusha/Desktop/neon/examples/skipthought/inference.py", line 132, in get_sim_score
    a = self.get_sentence_vec(text1)
  File "/home/pratyusha/Desktop/neon/examples/skipthought/inference.py", line 50, in get_sentence_vec
    parser = NeonArgparser(__doc__)
  File "/home/pratyusha/.virtualenvs/ronin/local/lib/python2.7/site-packages/neon/util/argparser.py", line 80, in __init__
    super(NeonArgparser, self).__init__(*args, **kwargs)
TypeError: __init__() got multiple values for keyword argument 'add_config_file_help'
(ronin)pratyusha@pratyusha-Q304UAK:~/Projects/ronin$python Retrieval-Eval.py
找不到记录器“gensim.models.doc2vec”的处理程序
你能为我们推荐一个水疗中心吗?
这里有交通设施吗?
回溯(最近一次呼叫最后一次):
文件“Retrieval Eval.py”,第484行,在
e=评估(对话,dtype=“str”,概念权重=1.0,任务权重=0)
文件“Retrieval Eval.py”,第248行,在evaluate中
retrieval2=获取任务匹配项(选中=问题,dtype=“str”,conceptW=概念权重,taskW=任务权重)##这里!!!!!!!!!!!!!
文件“Retrieval Eval.py”,第446行,在get\u skipsim\u matches中
conceptDictionary=get\u skipsim\u Conception\u dictionary(选中[1],数据类型)
文件“Retrieval Eval.py”,第464行,在get_skipsim_concept_字典中
得分=获取列表得分(选中、对话、数据类型)
文件“Retrieval Eval.py”,第430行,在get_list_skipsim_scores中
得分=st.get\U sim\U得分(第一季度、第二季度)
文件“/home/pratyusha/Desktop/neon/examples/skipthough/inference.py”,第132行,在get_sim_score中
a=自我获取句子向量(文本1)
文件“/home/pratyusha/Desktop/neon/examples/skipthough/inference.py”,第50行,在get_sequence_vec中
parser=NeonArgparser(_doc__)
文件“/home/pratyusha/.virtualenvs/ronin/local/lib/python2.7/site packages/neon/util/argparser.py”,第80行,在__
超级(NeonArgparser,self)。\uuuu初始值(*args,**kwargs)
TypeError:\uuuu init\uuuuuuuuuuuu()为关键字参数“添加配置文件\u帮助”获取了多个值

谢谢你`

这主要是因为最新版本的ConfigArgParse中有一个bug。
 TypeError: __init__() got multiple values for keyword argument 'add_config_file_help'                                     
**class NeonArgparser(configargparse.ArgumentParser):**
    """
    Setup the command line arg parser and parse the
    arguments in sys.arg (or from configuration file).  Use the parsed
    options to configure the logging module.*emphasized text*

    Arguments:
        desc (String) : Docstring from the calling function. This will be used
                        for the description of the command receiving the
                        arguments.
    """
    def __init__(self, *args, **kwargs):
        self._PARSED = False
        self.work_dir = os.path.join(os.path.expanduser('~'), 'nervana')
        if 'default_config_files' not in kwargs:
            kwargs['default_config_files'] = [os.path.join(self.work_dir,
                                                           'neon.cfg')]
        if 'add_config_file_help' not in kwargs:
            # turn off the auto-generated config help for config files since it
            # referenced unsettable config options like --version
            kwargs['add_config_file_help'] = False

        self.defaults = kwargs.pop('default_overrides', dict())
        super(NeonArgparser, self).__init__(*args, **kwargs)

        # ensure that default values are display via --help
        self.formatter_class = configargparse.ArgumentDefaultsHelpFormatter

        self.setup_default_args()
现在要解除阻止,请运行以下命令安装除最新版本以外的其他版本:

 TypeError: __init__() got multiple values for keyword argument 'add_config_file_help'                                     
**class NeonArgparser(configargparse.ArgumentParser):**
    """
    Setup the command line arg parser and parse the
    arguments in sys.arg (or from configuration file).  Use the parsed
    options to configure the logging module.*emphasized text*

    Arguments:
        desc (String) : Docstring from the calling function. This will be used
                        for the description of the command receiving the
                        arguments.
    """
    def __init__(self, *args, **kwargs):
        self._PARSED = False
        self.work_dir = os.path.join(os.path.expanduser('~'), 'nervana')
        if 'default_config_files' not in kwargs:
            kwargs['default_config_files'] = [os.path.join(self.work_dir,
                                                           'neon.cfg')]
        if 'add_config_file_help' not in kwargs:
            # turn off the auto-generated config help for config files since it
            # referenced unsettable config options like --version
            kwargs['add_config_file_help'] = False

        self.defaults = kwargs.pop('default_overrides', dict())
        super(NeonArgparser, self).__init__(*args, **kwargs)

        # ensure that default values are display via --help
        self.formatter_class = configargparse.ArgumentDefaultsHelpFormatter

        self.setup_default_args()

pip安装--no cache dir ConfigArgParse>=0.10.0,\=0.10.0,\n在未解释问题的情况下,不要转储代码。@chrisz我正试图在基于案例的推理系统中使用skipthougt模型执行检索任务。检索任务进行得很顺利,但我在生成结果时遇到了此错误。谢谢您使用所有相关信息编辑您的问题,包括完整的异常跟踪。不要在评论中回复。@Mad物理学家我已经发布了一个截图,你能帮我解决这个错误吗。这是紧急情况,不要发布截图。以文本形式发布文本,并正确设置格式。学会更好地管理你的时间。当你问一个包含所有必要信息的适当问题时,我会帮助你。