Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Python 3 fixups. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darrengarvey
Copy link

Non-functional changes to run with Python 3.

Incremental printing looks uglier in python 3 unfortunately (print 'foo', => print('foo',end=' ')), but the result should be the same.

Non-functional changes to run with Python 3.
pittacus added a commit to pittacus/progressive_growing_of_gans that referenced this pull request Jul 22, 2018
@gwern
Copy link

gwern commented Jan 6, 2019

ProGAN will also need some updates for CUDA 10/the next Tensorflow version, as they move one of the NCCL functions:

diff --git a/tfutil.py b/tfutil.py
index cf7ad0a..af970ed 100755
--- a/tfutil.py
+++ b/tfutil.py
@@ -13,6 +13,7 @@ import imp
 import numpy as np
 from collections import OrderedDict
 import tensorflow as tf
+from tensorflow.python.ops import nccl_ops
 
 #----------------------------------------------------------------------------
 # Convenience.
@@ -328,7 +329,7 @@ class Optimizer:
                     for var_idx, grad_shape in enumerate(self._grad_shapes):
                         g = [dev_grads[dev][var_idx][0] for dev in devices]
                         if np.prod(grad_shape): # nccl does not support zero-sized tensors
-                            g = tf.contrib.nccl.all_sum(g)
+                            g = nccl_ops.all_sum(g)
                         for dev, gg in zip(devices, g):
                             dev_grads[dev][var_idx] = (gg, dev_grads[dev][var_idx][1])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants