TensorFlow: AttributeError: 'Tensor' object has no attribute 'shape'

前端 未结 3 1178
萌比男神i
萌比男神i 2020-12-18 19:52

I have the following code which uses TensorFlow. After I reshape a list, it says

AttributeError: \'Tensor\' object has no attribute \'shape\'

3条回答
  •  攒了一身酷
    2020-12-18 20:31

    import tensorflow as tf
    

    and replace train_data.shape with tf.Session.run(tf.rank(train_data))

提交回复
热议问题