Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.face
Commits
ffcaf266
Commit
ffcaf266
authored
Jul 02, 2020
by
Tiago de Freitas Pereira
Browse files
Changed serialization mechanism
parent
5e1e99e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/face/embeddings/tensorflow_compat_v1.py
View file @
ffcaf266
...
...
@@ -10,7 +10,7 @@ import numpy as np
import
logging
from
sklearn.utils
import
check_array
from
bob.pipelines.sample
import
SampleBatch
import
copy
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -132,20 +132,14 @@ class TensorflowCompatV1(TransformerMixin, BaseEstimator):
self
.
__dict__
=
d
def
__getstate__
(
self
):
import
tensorflow
as
tf
# Handling unpicklable objects
d
=
self
.
__dict__
d
=
self
.
__dict__
.
copy
()
d
.
pop
(
"session"
,
None
)
d
.
pop
(
"input_tensor"
,
None
)
d
.
pop
(
"embedding"
,
None
)
tf
.
compat
.
v1
.
reset_default_graph
()
self
.
loaded
=
False
d
[
"loaded"
]
=
False
return
d
# def __del__(self):
# tf.compat.v1.reset_default_graph()
def
get_modelpath
(
self
,
bob_rc_variable
,
model_subdirectory
):
"""
Get default model path.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment