Browse Source

[bugfix]修复fitlogcallback在disttrainner中无法添加dev_data 的问题 (#348)

fix the distTrainer dev_data
tags/v1.0.0alpha
ROGERDJQ GitHub 3 years ago
parent
commit
f17343e19b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      fastNLP/core/dist_trainer.py

+ 5
- 0
fastNLP/core/dist_trainer.py View File

@@ -177,8 +177,13 @@ class DistTrainer():
self.batch_size = self.world_size * self.batch_size_per_gpu
self.n_steps = self._get_n_steps()

self.dev_data = dev_data
self.metrics = metrics
self.test_use_tqdm = True
self.kwargs = kwargs
self.test_use_tqdm = kwargs.get('test_use_tqdm', self.use_tqdm)
dev_batch_size = kwargs.get('dev_batch_size', batch_size_per_gpu)

# for evaluation, only run eval on master proc
if dev_data and metrics:
cb = _TesterCallback(


Loading…
Cancel
Save