Skip to content

Commit 299c1bc

Browse files
committedJan 9, 2019
workaround for train_set batching during inference time
1 parent b384686 commit 299c1bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎neuralmonkey/learning_utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from termcolor import colored
1414

1515
from neuralmonkey.logging import log, log_print, warn
16-
from neuralmonkey.dataset import Dataset
16+
from neuralmonkey.dataset import Dataset, BatchingScheme
1717
from neuralmonkey.tf_manager import TensorFlowManager
1818
from neuralmonkey.runners.base_runner import (
1919
BaseRunner, ExecutionResult, GraphExecutor, OutputSeries)
@@ -85,6 +85,9 @@ def training_loop(cfg: Namespace) -> None:
8585
trainer_result = cfg.tf_manager.execute(
8686
batch, feedables, cfg.trainers, train=True,
8787
summaries=True)
88+
# workaround: we need to use validation batching scheme
89+
# during evaluation
90+
batch.batching = BatchingScheme(batch_size=cfg.batch_size)
8891
train_results, train_outputs, f_batch = run_on_dataset(
8992
cfg.tf_manager, cfg.runners, cfg.dataset_runner, batch,
9093
cfg.postprocess, write_out=False)

0 commit comments

Comments
 (0)
Failed to load comments.