TensorFlow - Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32

前端 未结 2 399
独厮守ぢ
独厮守ぢ 2020-12-16 12:19

I\'ve installed tensorflow using pip on ubuntu 16.04 LTS, when running this code https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/r

相关标签:
2条回答
  • 2020-12-16 12:56

    It is because the argument order has changed

    You can see the issue here : https://github.com/tensorflow/tensorflow/issues/6501

    0 讨论(0)
  • 2020-12-16 13:00

    It looks like you are using an older version of Tensorflow, and need to update to Tensorflow v0.12.0 or above. The error you are getting is indicating that the split_dim value in your tf.split function is expecting an integer, but is receiving the tensor x which is of type float32.

    This is because in Tensorflow versions < 0.12.0 the split function takes the arguments as:

    x = tf.split(0, n_steps, x) # tf.split(axis, num_or_size_splits, value)
    

    The tutorial you are working from was written for versions > 0.12.0, which has been changed to be consistent with Numpy's split syntax:

    x = tf.split(x, n_steps, 0) # tf.split(value, num_or_size_splits, axis)
    

    See the changelog for details: https://github.com/tensorflow/tensorflow/blob/64edd34ce69b4a8033af5d217cb8894105297d8a/RELEASE.md

    0 讨论(0)
提交回复
热议问题