ValueError: Can’t convert non-rectangular Python sequence to Tensor

I’m not sure whether they exist in TensorFlow 1 but TensorFlow 2.0 supports RaggedTensors, which the documentation describes as “… the TensorFlow equivalent of nested variable-length lists.”

I think it would be trivial to convert your data to RaggedTensors. It might even be as easy as:

data_tensor = tf.ragged.constant(data)

Example:

>>> a = tf.ragged.constant([[1],[2,3]])
>>> a
<tf.RaggedTensor [[1], [2, 3]]>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)