2

using python 3.x tensorflow version 1.8.0

code1:

a2 = [['1', '2'], ['1', '2']]
print(tf.shape(a2))

cod2:

a2 = [['1', '2', '3'], ['1']] 
print(tf.shape(a2))

cod1 is success but code2 error:

ValueError: Argument must be a dense tensor: [['1', '2', '3'], ['1']] - got shape [2], but wanted [2, 3].

tensorflow var has balance? why code2 is error?

ᴀʀᴍᴀɴ
  • 4,443
  • 8
  • 37
  • 57
CancerYoon
  • 89
  • 1
  • 2
  • 9
  • 1
    What kind of question is "tensorflow var has balance?" – nbro Jul 05 '18 at 06:02
  • 2
    Furthermore, read [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – nbro Jul 05 '18 at 06:02

1 Answers1

4

You can't have a list of lists with different sizes as a tensor.

To solve it, take a look at this or this

Tareq
  • 73
  • 5