From a93901056efc754213c7e4051ad3927987286529 Mon Sep 17 00:00:00 2001 From: npuichigo <418121364@qq.com> Date: Mon, 11 Sep 2017 16:27:49 +0800 Subject: [PATCH] Move utils/dataset.py to legacy and we will use tf.contrib.data.Dataset instead for data loading. --- src/{utils => legacy}/datasets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename src/{utils => legacy}/datasets.py (97%) diff --git a/src/utils/datasets.py b/src/legacy/datasets.py similarity index 97% rename from src/utils/datasets.py rename to src/legacy/datasets.py index 7eaa0d3..ab4425a 100644 --- a/src/utils/datasets.py +++ b/src/legacy/datasets.py @@ -25,7 +25,7 @@ import tensorflow as tf sys.path.append(os.path.dirname(sys.path[0])) -from io_funcs.tfrecords_io import get_padded_batch +from io_funcs.tfrecords_io import get_padded_batch, get_seq2seq_batch class SequenceDataset(snt.AbstractModule): @@ -53,7 +53,7 @@ def __init__(self, subset, config_dir, data_dir, batch_size, self._num_epochs = num_epochs self._infer = infer self._tfrecords_lst = self.read_config_file(subset) - self._num_batches = int(math.ceil(len(self._tfrecords_lst) / self._batch_size)) + self._num_batches = int(math.ceil(len(self._tfrecords_lst) / float(self._batch_size))) def _build(self): if not self._infer: