Commit f2cc091a authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Use bob.extension to load the config files

parent efe0969c
Pipeline #14493 failed with stages
in 17 minutes and 32 seconds
......@@ -93,7 +93,7 @@ import random
import pkg_resources
import tensorflow as tf
from bob.io.base import create_directories_safe
from bob.bio.base.utils import read_config_file
from bob.extension.config import load as read_config_file
from bob.learn.tensorflow.utils.commandline import \
get_from_config_or_commandline
from bob.core.log import setup, set_verbosity_level
......
......@@ -43,7 +43,7 @@ import os
import time
import six
import tensorflow as tf
from bob.bio.base.utils import read_config_file
from bob.extension.config import load as read_config_file
from ..utils.eval import get_global_step
......
......@@ -112,7 +112,8 @@ from multiprocessing import Pool
from collections import defaultdict
import numpy as np
from bob.io.base import create_directories_safe
from bob.bio.base.utils import read_config_file, save
from bob.bio.base.utils import save
from bob.extension.config import load as read_config_file
from bob.bio.base.tools.grid import indices
from bob.learn.tensorflow.utils.commandline import \
get_from_config_or_commandline
......
......@@ -53,7 +53,8 @@ from multiprocessing import Pool
from collections import defaultdict
import numpy as np
from bob.io.base import create_directories_safe
from bob.bio.base.utils import read_config_file, save
from bob.extension.config import load as read_config_file
from bob.bio.base.utils import save
from bob.learn.tensorflow.utils.commandline import \
get_from_config_or_commandline
from bob.core.log import setup, set_verbosity_level
......
......@@ -39,7 +39,7 @@ from __future__ import division
from __future__ import print_function
# import pkg_resources so that bob imports work properly:
import pkg_resources
from bob.bio.base.utils import read_config_file
from bob.extension.config import load as read_config_file
from bob.learn.tensorflow.utils.commandline import \
get_from_config_or_commandline
from bob.core.log import setup, set_verbosity_level
......
......@@ -2,8 +2,6 @@ from __future__ import print_function
import os
from tempfile import mkdtemp
import shutil
import logging
logging.getLogger("tensorflow").setLevel(logging.WARNING)
from bob.io.base.test_utils import datafile
from bob.learn.tensorflow.script.db_to_tfrecords import main as tfrecords
......@@ -13,7 +11,6 @@ from bob.learn.tensorflow.script.eval_generic import main as eval_generic
dummy_tfrecord_config = datafile('dummy_verify_config.py', __name__)
CONFIG = '''
import tensorflow as tf
from bob.learn.tensorflow.utils.reproducible import run_config
from bob.learn.tensorflow.dataset.tfrecords import shuffle_data_and_labels, \
batch_data_and_labels
......@@ -88,8 +85,7 @@ def model_fn(features, labels, mode, params, config):
eval_metric_ops=metrics)
estimator = tf.estimator.Estimator(model_fn=model_fn, model_dir=model_dir,
config=run_config)
estimator = tf.estimator.Estimator(model_fn=model_fn, model_dir=model_dir)
'''
......
......@@ -11,7 +11,7 @@ def get_from_config_or_commandline(config, keyword, args, defaults,
Parameters
----------
config : object
config : :any:`module`
The loaded config files.
keyword : str
The keyword to load from the config file or through command line.
......@@ -30,7 +30,7 @@ def get_from_config_or_commandline(config, keyword, args, defaults,
Example
-------
>>> from bob.bio.base.utils import read_config_file
>>> from bob.extension.config import load as read_config_file
>>> defaults = docopt(docs, argv=[""])
>>> args = docopt(docs, argv=argv)
>>> config_files = args['<config_files>']
......
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