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

unexpected keyword argument 'keepdims' #29

Open
knauth opened this issue Feb 16, 2018 · 3 comments
Open

unexpected keyword argument 'keepdims' #29

knauth opened this issue Feb 16, 2018 · 3 comments

Comments

@knauth
Copy link

knauth commented Feb 16, 2018

when running train.py i get the following issue:

C:\Users\cknau\Downloads\pixel-cnn-master\pixel-cnn-master>python train2.py
input args:
{
"data_dir":"D:\PixelCNN\dataset",
"save_dir":"D:\PixelCNN\samples",
"data_set":"cifar",
"save_interval":20,
"load_params":false,
"nr_resnet":5,
"nr_filters":160,
"nr_logistic_mix":10,
"resnet_nonlinearity":"concat_elu",
"class_conditional":false,
"energy_distance":false,
"learning_rate":0.001,
"lr_decay":0.999995,
"batch_size":16,
"init_batch_size":16,
"dropout_p":0.5,
"max_epochs":5000,
"nr_gpu":8,
"polyak_decay":0.9995,
"num_samples":1,
"seed":1
}
Traceback (most recent call last):
File "train2.py", line 120, in
loss_gen.append(loss_fun(tf.stop_gradient(xs[i]), out))
File "C:\Users\cknau\Downloads\pixel-cnn-master\pixel-cnn-master\pixel_cnn_pp\nn.py", line 83, in discretized_mix_logistic_loss
log_probs = tf.reduce_sum(log_probs,3) + log_prob_from_logits(logit_probs)
File "C:\Users\cknau\Downloads\pixel-cnn-master\pixel-cnn-master\pixel_cnn_pp\nn.py", line 27, in log_prob_from_logits
m = tf.reduce_max(x, axis, keepdims=True)
TypeError: reduce_max() got an unexpected keyword argument 'keepdims'

Anyone know what's going on here. I have NumPy 1.13, so that's not the issue.

@xie9187
Copy link

xie9187 commented Mar 7, 2018

Same problem with ubuntu 16.04 and tensorflow 1.4.1

@gorogoroyasu
Copy link

gorogoroyasu commented Mar 15, 2018

I got the same error, and I found that according to the TensorFlow docs, the option has to be keep_dims instead of keepdims in the latest version, and Tensorflow 1.4.1 also.

so, you should modify pixel_cnn_pp/nn.py.

docs: https://www.tensorflow.org/api_docs/python/tf/reduce_sum
r1.4 branch code: https://github.com/tensorflow/tensorflow/blob/r1.4/tensorflow/python/ops/math_ops.py#L1263

@KevinZu
Copy link

KevinZu commented Jan 21, 2019

@gorogoroyasu thank you!

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

No branches or pull requests

4 participants