From 2831d7526a0b9dfef8be67892821827ea994d746 Mon Sep 17 00:00:00 2001 From: tangwei Date: Wed, 29 Apr 2020 12:35:37 +0800 Subject: [PATCH] fix platform --- fleetrec/core/model.py | 3 ++- fleetrec/models/ctr/dnn/model.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fleetrec/core/model.py b/fleetrec/core/model.py index 4d30627d..9f940b6c 100644 --- a/fleetrec/core/model.py +++ b/fleetrec/core/model.py @@ -1,5 +1,5 @@ import abc - +from fleetrec.core.utils import envs class Model(object): """R @@ -15,6 +15,7 @@ class Model(object): self._data_loader = None self._fetch_interval = 20 self._namespace = "train.model" + self._platform = envs.get_platform() def get_inputs(self): return self._data_var diff --git a/fleetrec/models/ctr/dnn/model.py b/fleetrec/models/ctr/dnn/model.py index 7816e5a7..ac3887d7 100644 --- a/fleetrec/models/ctr/dnn/model.py +++ b/fleetrec/models/ctr/dnn/model.py @@ -57,8 +57,10 @@ class Model(ModelBase): self._data_var.append(input) self._data_var.append(self.label_input) - self._data_loader = fluid.io.PyReader( - feed_list=self._data_var, capacity=64, use_double_buffer=False, iterable=False) + + if self._platform != "LINUX": + self._data_loader = fluid.io.PyReader( + feed_list=self._data_var, capacity=64, use_double_buffer=False, iterable=False) def net(self): trainer = envs.get_trainer() -- GitLab