shentianxiao / language-style-transfer

Apache License 2.0
553 stars 135 forks source link

TypeError during training startup #25

Closed michelecafagna26 closed 5 years ago

michelecafagna26 commented 5 years ago

I got this error on training startup that I can't figure out. Data is formatted as described in the README with the correct naming, 1 line per sentence. used : -nvidia-docker -tensorflow-gpu 1.13.1

Traceback (most recent call last): File "style_transfer.py", line 228, in model = create_model(sess, args, vocab) File "style_transfer.py", line 192, in create_model model = Model(args, vocab) File "style_transfer.py", line 120, in init zeros, ones = self.labels[:half], self.labels[half:] File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/array_ops.py", line 597, in _slice_helper _check_index(s.stop) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/array_ops.py", line 516, in _check_index raise TypeError(_SLICE_TYPE_ERROR + ", got {!r}".format(idx)) TypeError: Only integers, slices (:), ellipsis (...), tf.newaxis (None) and scalar tf.int32/tf.int64 tensors are valid indices, got <tf.Tensor 'truediv_1:0' shape= dtype=float64>

michelecafagna26 commented 5 years ago

Fixed using python 2 and tensorflow 1.3.0