From b40259c61a5cab7db80243dd865b3658ddf1b3e4 Mon Sep 17 00:00:00 2001 From: Itai Caspi Date: Mon, 6 Nov 2017 17:28:13 +0200 Subject: [PATCH] bug fix - remove import warning when everything was imported successfully + changed global step api to match TF 1.4 --- architectures/tensorflow_components/architecture.py | 2 +- coach.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/architectures/tensorflow_components/architecture.py b/architectures/tensorflow_components/architecture.py index 19cb99d..276a122 100644 --- a/architectures/tensorflow_components/architecture.py +++ b/architectures/tensorflow_components/architecture.py @@ -49,7 +49,7 @@ class TensorFlowArchitecture(Architecture): if self.tp.seed is not None: tf.set_random_seed(self.tp.seed) with tf.variable_scope(self.name, initializer=tf.contrib.layers.xavier_initializer()): - self.global_step = tf.contrib.framework.get_or_create_global_step() + self.global_step = tf.train.get_or_create_global_step() # build the network self.get_model(tuning_parameters) diff --git a/coach.py b/coach.py index bcd2089..1624632 100644 --- a/coach.py +++ b/coach.py @@ -30,7 +30,8 @@ from subprocess import Popen import datetime import presets -screen.warning("Warning: failed to import the following packages - {}".format(', '.join(set(failed_imports)))) +if len(set(failed_imports)) > 0: + screen.warning("Warning: failed to import the following packages - {}".format(', '.join(set(failed_imports)))) time_started = datetime.datetime.now() cur_time = time_started.time()