You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when trying to run output_df.show(), it throws the following error message.
Py4JJavaError: An error occurred while calling o848.buildDF.
: java.lang.UnsupportedOperationException: empty.tail
at scala.collection.TraversableLike$class.tail(TraversableLike.scala:421)
at scala.collection.mutable.ArrayOps$ofLong.scala$collection$IndexedSeqOptimized$$super$tail(ArrayOps.scala:246)
at scala.collection.IndexedSeqOptimized$class.tail(IndexedSeqOptimized.scala:129)
at scala.collection.mutable.ArrayOps$ofLong.tail(ArrayOps.scala:246)
at org.tensorframes.Shape.tail(Shape.scala:49)
at org.tensorframes.ColumnInformation$.structField(ColumnInformation.scala:82)
at org.tensorframes.impl.DebugRowOps$$anonfun$29.apply(DebugRowOps.scala:357)
at org.tensorframes.impl.DebugRowOps$$anonfun$29.apply(DebugRowOps.scala:351)
at scala.collection.immutable.Stream.map(Stream.scala:418)
at org.tensorframes.impl.DebugRowOps.mapBlocks(DebugRowOps.scala:351)
at org.tensorframes.impl.DebugRowOps.mapBlocks(DebugRowOps.scala:294)
at org.tensorframes.impl.PythonOpBuilder.buildDF(PythonInterface.scala:145)
It seems that tf.reduce_mean changes the leading (i.e. batch) dimension, which would lead to the final DataFrame not having the same number of rows as the input DataFrame.
It will be nice to prompt the user that tensors in fetches must have the same leading dimension as the input tensors.
For this example, changing tf.reduce_mean(x) to tf.reduce_mean(x, axis=1) gives the desired output.
@phi-dbq thanks. Yes, this error should be made more explicit. Just to confirm, in that case the shape of tf.reduce_mean(x) is going to be [17], if I am not mistaken?
Activity
phi-dbq commentedon Aug 9, 2017
Below is a small example in which the output tensor is scalar.
TensorFrame is capable to infer the block size as
But when trying to run
output_df.show(), it throws the following error message.phi-dbq commentedon Aug 9, 2017
It seems that
tf.reduce_meanchanges the leading (i.e. batch) dimension, which would lead to the final DataFrame not having the same number of rows as the input DataFrame.It will be nice to prompt the user that tensors in fetches must have the same leading dimension as the input tensors.
For this example, changing
tf.reduce_mean(x)totf.reduce_mean(x, axis=1)gives the desired output.thunterdb commentedon Aug 10, 2017
@phi-dbq thanks. Yes, this error should be made more explicit. Just to confirm, in that case the shape of
tf.reduce_mean(x)is going to be[17], if I am not mistaken?phi-dbq commentedon Aug 10, 2017
@thunterdb thanks. Currently tf.reduce_mean without specifying the
axisparameter will reduce along all dimensions. It became a scalar.