diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-10 15:51:28 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-10 15:51:28 +0100 |
| commit | 1b9eec18c423c881abee0ea6ab5048be92055acc (patch) | |
| tree | b782bfe9eda2b66a1caaa72569c5ce45e27edf33 | |
| parent | 2296ffe47783dfce4a61fb2ed2a7bcf5b65ce817 (diff) | |
graph magic
| -rw-r--r-- | cli/app/search/live.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/app/search/live.py b/cli/app/search/live.py index 15fb754..9dcf4a8 100644 --- a/cli/app/search/live.py +++ b/cli/app/search/live.py @@ -220,9 +220,8 @@ class Interpolator: gen_layer_name = 'module_apply_' + gen_signature + '/' + params.inv_layer encoding_latent = tf.get_default_graph().get_tensor_by_name(gen_layer_name) - print(encoding_latent.get_shape()) - encoding_shape = [1,] + encoding_latent.get_shape().as_list()[1:] - print(encoding_shape) + # encoding_shape = tuple([1,] + encoding_latent.get_shape().as_list()[1:]) + encoding_shape = encoding_latent.get_shape().as_list() encoding_shape_placeholder = tf.constant(np.zeros(encoding_shape, dtype=np.float32)) encoding_stored = LerpParam('encoding_stored', shape=encoding_shape, datatype="encoding") encoding_mix = LerpParam('encoding_mix', a_in=encoding_latent, b_in=encoding_shape_placeholder, shape=encoding_shape, datatype="encoding") @@ -230,7 +229,7 @@ class Interpolator: # - computed encoding goes into the encoding_mix # - encoding mix output goes into the main biggan graph tf.contrib.graph_editor.swap_ts(encoding_latent, encoding_shape_placeholder) - tf.contrib.graph_editor.swap_ts(encoding_shape_placeholder, tf.convert_to_tensor(encoding_mix.output)) + tf.contrib.graph_editor.swap_ts(encoding_shape_placeholder, encoding_mix.output) sys.stderr.write("Sin params: {}\n".format(", ".join(self.sin_params.keys()))) sys.stderr.write("Lerp params: {}\n".format(", ".join(self.lerp_params.keys()))) |
