From 6ff33c4b8097561d5ad5dcba7fe47ae8ceaf6a14 Mon Sep 17 00:00:00 2001 From: yh_cc Date: Tue, 14 May 2019 23:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastNLP/core/trainer.py | 2 ++ fastNLP/core/utils.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fastNLP/core/trainer.py b/fastNLP/core/trainer.py index 2ad92f6b..a6293167 100644 --- a/fastNLP/core/trainer.py +++ b/fastNLP/core/trainer.py @@ -381,6 +381,8 @@ class Trainer(object): 5. None. 为None则不对模型进行任何处理,如果传入的model为torch.nn.DataParallel该值必须为None。 + 已知可能会出现的问题:Adagrad优化器可能无法正常使用这个参数,请手动管理模型位置。 + :param list(callbacks) callbacks: 用于在train过程中起调节作用的回调函数。比如early stop,negative sampling等可以 通过callback机制实现。 可使用的callback参见 :doc:`callback模块 ` :param int check_code_level: 模型检查等级. -1: 不进行检查; 0: 仅出现错误时停止; 1: 如果有field没有被使用, diff --git a/fastNLP/core/utils.py b/fastNLP/core/utils.py index f7539fd7..fa8f6feb 100644 --- a/fastNLP/core/utils.py +++ b/fastNLP/core/utils.py @@ -88,7 +88,7 @@ def cache_results(_cache_fp, _refresh=False, _verbose=1): def wrapper_(func): signature = inspect.signature(func) for key, _ in signature.parameters.items(): - if key in ('cache_filepath', 'refresh', 'verbose'): + if key in ('_cache_fp', '_refresh', '_verbose'): raise RuntimeError("The function decorated by cache_results cannot have keyword `{}`.".format(key)) def wrapper(*args, **kwargs): if '_cache_fp' in kwargs: