Zeta36 / tensorflow-tex-wavenet

This is a TensorFlow implementation of the WaveNet generative neural network architecture https://deepmind.com/blog/wavenet-generative-model-raw-audio/ for text generation.
MIT License
343 stars 64 forks source link

training train.py error #5

Open ghost opened 6 years ago

ghost commented 6 years ago

$ python train.py --data_dir=data Using default logdir: ./logdir/train/2018-01-12T15-57-55 Traceback (most recent call last): File "train.py", line 245, in main() File "train.py", line 190, in main loss = net.loss(text_batch, args.l2_regularization_strength) File "/home/nis-centos/tensorflow-tex-wavenet/wavenet/model.py", line 452, in loss tf.reshape(shifted, [-1, self.quantization_channels])) File "/home/nis-centos/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1558, in softmax_cross_entropy_with_logits labels, logits) File "/home/nis-centos/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1512, in _ensure_xent_args "named arguments (labels=..., logits=..., ...)" % name) ValueError: Only call softmax_cross_entropy_with_logits with named arguments (labels=..., logits=..., ...)

How to solve it ,thank you ?

gaceladri commented 6 years ago

Change it to:

loss = tf.nn.softmax_cross_entropy_with_logits_v2(
                    **labels**=prediction,
                    **logits**=tf.reshape(shifted, [-1, self.quantization_channels]))