Browse Source

element如果没有初始化在reset时不起作用

tags/1.0.0beta2
yhcc 2 years ago
parent
commit
e2c8aae798
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      fastNLP/core/metrics/element.py
  2. +2
    -2
      fastNLP/io/utils.py

+ 1
- 1
fastNLP/core/metrics/element.py View File

@@ -88,7 +88,7 @@ class Element:
"""
重置 value
"""
if self.backend.is_specified():
if self.backend.is_specified() and self._value is not None:
self._value = self.backend.fill_value(self._value, self.init_value)

@property


+ 2
- 2
fastNLP/io/utils.py View File

@@ -52,8 +52,8 @@ def check_loader_paths(paths: Union[str, Dict[str, str]]) -> Dict[str, str]:
path_pair = ('test', filename)
if path_pair:
if path_pair[0] in files:
raise FileExistsError(f"Two files contain `{path_pair[0]}` were found, please specify the "
f"filepath for `{path_pair[0]}`.")
raise FileExistsError(f"Two files contain `{path_pair[0]}` were found in {paths}, please specify "
f"the filepath for `{path_pair[0]}`.")
files[path_pair[0]] = os.path.join(paths, path_pair[1])
# if 'train' not in files:
# raise KeyError(f"There is no train file in {paths}.")


Loading…
Cancel
Save