Commit 0943c5e7 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Changed picklable methods for the embeddings

parent 73f1457f
Pipeline #40572 failed with stage
in 2 minutes and 52 seconds
......@@ -223,7 +223,6 @@ class FaceNetSanderberg(TransformerMixin, BaseEstimator):
def __setstate__(self, d):
# Handling unpicklable objects
self.__dict__ = d
self.loaded = False
def __getstate__(self):
import tensorflow as tf
......@@ -236,6 +235,7 @@ class FaceNetSanderberg(TransformerMixin, BaseEstimator):
d.pop("images_placeholder") if "images_placeholder" in d else None
d.pop("phase_train_placeholder") if "phase_train_placeholder" in d else None
tf.compat.v1.reset_default_graph()
self.loaded = False
return d
def _more_tags(self):
......
......@@ -122,8 +122,7 @@ class TensorflowCompatV1(TransformerMixin, BaseEstimator):
def __setstate__(self, d):
# Handling unpicklable objects
self.__dict__ = d
self.loaded = False
self.__dict__ = d
def __getstate__(self):
import tensorflow as tf
......@@ -134,6 +133,7 @@ class TensorflowCompatV1(TransformerMixin, BaseEstimator):
d.pop("input_tensor", None)
d.pop("embedding", None)
tf.compat.v1.reset_default_graph()
self.loaded = False
return d
# def __del__(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment