summaryrefslogtreecommitdiff
path: root/cli/app/commands/biggan/search_class.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-01-06 15:41:08 +0100
committerJules Laplace <julescarbon@gmail.com>2020-01-06 15:41:08 +0100
commitb6a4e8e477a4f00c94f5bb7afdfd0a68f995fe2d (patch)
tree0b8da7e29bfb5ca52c4eaee9684e5ad33e272d88 /cli/app/commands/biggan/search_class.py
parent4b19d120183d7fa07d7e633b127d77bc1f437aad (diff)
getting it running..?
Diffstat (limited to 'cli/app/commands/biggan/search_class.py')
-rw-r--r--cli/app/commands/biggan/search_class.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/app/commands/biggan/search_class.py b/cli/app/commands/biggan/search_class.py
index 658f4a8..b0d957b 100644
--- a/cli/app/commands/biggan/search_class.py
+++ b/cli/app/commands/biggan/search_class.py
@@ -17,6 +17,8 @@ import tensorflow_hub as hub
import shutil
import h5py
+tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
+
from app.search.json import save_params_latent, save_params_dense
from app.search.image import image_to_uint8, imconvert_uint8, imconvert_float32, \
imread, imwrite, imgrid, resize_and_crop_image
@@ -136,13 +138,13 @@ def find_nearest_vector(sess, opt_fp_in, opt_dims, out_images, out_labels, out_l
try:
print("Iteration start")
for i in range(opt_steps):
- sess.run([train_step_z, train_step_y, loss], feed_dict=feed_dict)
+ curr_loss, _, _ = sess.run([loss, train_step_z, train_step_y], feed_dict=feed_dict)
phi_guess = sess.run(output)
guess_im = imconvert_uint8(phi_guess)
imwrite(join(app_cfg.DIR_OUTPUTS, fp_frames, 'frame_{:04d}.png'.format(i)), guess_im)
if i % 20 == 0:
- print('lr: {}, iter: {}, grad_z: {}, grad_y: {}'.format(lr_z, i, np.std(grad_z), np.std(grad_y)))
+ print('iter: {}, loss: {}'.format(i, curr_loss))
except KeyboardInterrupt:
pass