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.learn.tensorflow
Commits
b1a034e5
Commit
b1a034e5
authored
Nov 18, 2019
by
Tiago de Freitas Pereira
Browse files
Added @attr(slow) for slow tests
parent
e825af8b
Pipeline
#35440
passed with stage
in 139 minutes and 18 seconds
Changes
7
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
bob/learn/tensorflow/test/test_architectures.py
View file @
b1a034e5
...
...
@@ -2,12 +2,13 @@
# vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
from
nose.plugins.attrib
import
attr
import
tensorflow
as
tf
from
bob.learn.tensorflow.network
import
inception_resnet_v2
,
inception_resnet_v2_batch_norm
,
\
inception_resnet_v1
,
inception_resnet_v1_batch_norm
,
\
vgg_19
,
vgg_16
,
mlp_with_batchnorm_and_dropout
@
attr
(
'slow'
)
def
test_inceptionv2
():
tf
.
reset_default_graph
()
...
...
@@ -27,7 +28,7 @@ def test_inceptionv2():
tf
.
reset_default_graph
()
assert
len
(
tf
.
global_variables
())
==
0
@
attr
(
'slow'
)
def
test_inceptionv2_adaptation
():
tf
.
reset_default_graph
()
...
...
@@ -52,7 +53,7 @@ def test_inceptionv2_adaptation():
tf
.
reset_default_graph
()
assert
len
(
tf
.
global_variables
())
==
0
@
attr
(
'slow'
)
def
test_inceptionv1
():
tf
.
reset_default_graph
()
...
...
@@ -72,7 +73,7 @@ def test_inceptionv1():
tf
.
reset_default_graph
()
assert
len
(
tf
.
global_variables
())
==
0
@
attr
(
'slow'
)
def
test_inceptionv1_adaptation
():
tf
.
reset_default_graph
()
...
...
bob/learn/tensorflow/test/test_estimator_onegraph.py
View file @
b1a034e5
...
...
@@ -2,6 +2,7 @@
# vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
from
nose.plugins.attrib
import
attr
import
tensorflow
as
tf
from
bob.learn.tensorflow.network
import
dummy
...
...
@@ -36,7 +37,7 @@ epochs = 6
steps
=
5000
reproducible
.
set_seed
()
@
attr
(
'slow'
)
def
test_logitstrainer
():
# Trainer logits
try
:
...
...
@@ -62,7 +63,7 @@ def test_logitstrainer():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_logitstrainer_embedding
():
try
:
embedding_validation
=
True
...
...
@@ -86,7 +87,7 @@ def test_logitstrainer_embedding():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_logitstrainer_centerloss
():
try
:
embedding_validation
=
False
...
...
@@ -123,7 +124,7 @@ def test_logitstrainer_centerloss():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_logitstrainer_centerloss_embedding
():
try
:
embedding_validation
=
True
...
...
@@ -219,7 +220,7 @@ def run_logitstrainer_mnist(trainer, augmentation=False):
tf
.
reset_default_graph
()
assert
len
(
tf
.
global_variables
())
==
0
@
attr
(
'slow'
)
def
test_moving_average_trainer
():
# define a fixed input data
# train the same network with the same initialization
...
...
@@ -305,7 +306,7 @@ def test_moving_average_trainer():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_saver_with_moving_average
():
try
:
_
,
run_config
,
_
,
_
,
_
=
reproducible
.
set_seed
()
...
...
bob/learn/tensorflow/test/test_estimator_scripts.py
View file @
b1a034e5
...
...
@@ -12,6 +12,7 @@ from bob.learn.tensorflow.script.train import train
from
bob.learn.tensorflow.script.eval
import
eval
as
eval_script
from
bob.learn.tensorflow.script.train_and_evaluate
import
train_and_evaluate
from
bob.learn.tensorflow.script.predict_bio
import
predict_bio
from
nose.plugins.attrib
import
attr
db_to_tfrecords_config
=
datafile
(
'db_to_tfrecords_config.py'
,
__name__
)
...
...
@@ -83,7 +84,7 @@ def _predict_bio(tmpdir, model_dir, tfrecord_path, extra_options=tuple()):
predict_bio
,
args
=
[
config_path
,
input_predict_bio_config
]
+
list
(
extra_options
))
@
attr
(
'slow'
)
def
test_eval
():
tmpdir
=
mkdtemp
(
prefix
=
'bob_'
)
try
:
...
...
@@ -116,7 +117,7 @@ def test_eval():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_eval_keep_n_model
():
tmpdir
=
mkdtemp
(
prefix
=
'bob_'
)
try
:
...
...
@@ -147,7 +148,7 @@ def test_eval_keep_n_model():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_predict_bio
():
tmpdir
=
mkdtemp
(
prefix
=
'bob_'
)
try
:
...
...
@@ -167,7 +168,7 @@ def test_predict_bio():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_predict_bio_empty_eval
():
tmpdir
=
mkdtemp
(
prefix
=
'bob_'
)
try
:
...
...
bob/learn/tensorflow/test/test_estimator_siamese.py
View file @
b1a034e5
...
...
@@ -2,6 +2,7 @@
# vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
from
nose.plugins.attrib
import
attr
import
tensorflow
as
tf
from
bob.learn.tensorflow.network
import
dummy
...
...
@@ -78,7 +79,7 @@ filenames = [
]
labels
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
]
@
attr
(
'slow'
)
def
test_siamesetrainer
():
# Trainer logits
try
:
...
...
@@ -102,7 +103,7 @@ def test_siamesetrainer():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_siamesetrainer_transfer
():
def
logits_input_fn
():
return
single_batch
(
...
...
@@ -157,7 +158,7 @@ def test_siamesetrainer_transfer():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_siamesetrainer_transfer_extraparams
():
def
logits_input_fn
():
return
single_batch
(
...
...
bob/learn/tensorflow/test/test_estimator_transfer.py
View file @
b1a034e5
...
...
@@ -2,6 +2,7 @@
# vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
from
nose.plugins.attrib
import
attr
import
tensorflow
as
tf
from
bob.learn.tensorflow.network
import
dummy
...
...
@@ -80,7 +81,7 @@ def dummy_adapted(inputs,
return
graph
,
end_points
@
attr
(
'slow'
)
def
test_logitstrainer
():
# Trainer logits
try
:
...
...
@@ -130,7 +131,7 @@ def test_logitstrainer():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_logitstrainer_center_loss
():
# Trainer logits
try
:
...
...
bob/learn/tensorflow/test/test_estimator_triplet.py
View file @
b1a034e5
...
...
@@ -2,6 +2,7 @@
# vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
from
nose.plugins.attrib
import
attr
import
tensorflow
as
tf
from
bob.learn.tensorflow.network
import
dummy
...
...
@@ -76,7 +77,7 @@ filenames = [
]
labels
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
]
@
attr
(
'slow'
)
def
test_triplet_estimator
():
# Trainer logits
try
:
...
...
@@ -94,7 +95,7 @@ def test_triplet_estimator():
except
Exception
:
pass
@
attr
(
'slow'
)
def
test_triplettrainer_transfer
():
def
logits_input_fn
():
return
single_batch
(
...
...
bob/learn/tensorflow/test/test_regression.py
View file @
b1a034e5
from
nose.plugins.attrib
import
attr
from
bob.learn.tensorflow.estimators
import
Regressor
from
tensorflow
import
keras
import
tensorflow
as
tf
import
tensorflow.contrib.slim
as
slim
@
attr
(
'slow'
)
def
test_regressor
():
boston_housing
=
keras
.
datasets
.
boston_housing
...
...
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