Big NDArray generate Operand Tensor meet protobuf exceeded maximum protobuf size of 2GB ?

Open
#464 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, scala

Research direction

Start with the reported Ops.constant and Constant.tensorOf call path, using the SparkConverter-generated DoubleNdArray and the smaller filtered DataFrame as contrasting inputs. Reproduce the protobuf size failure and determine the expected behavior for tensors above 2GB; the issue does not define a requested change or a clear completion test.

Written by the indexing model from the issue text.

Description

Hi :
from spark DataFrame generate org.tensorflow.ndarray.DoubleNdArray , after I want to generate Operand[TFloat64] tensor , meet error


scala> val featureVector = SparkConverter.sparkDataframeFeatureVectorConvertTfTensor(finalInputDf,"final_features" )
featureVector: org.tensorflow.ndarray.DoubleNdArray = org.tensorflow.ndarray.impl.dense.DoubleDenseNdArray@e3f6a6a0
scala> val ft  = tf.constant(featureVector)
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/message_lite.cc:451] tensorflow.AttrValue exceeded maximum protobuf size of 2GB: 6279090916
org.tensorflow.exceptions.TFInvalidArgumentException: AttrValue missing value with expected type 'tensor'
         for attr 'value'
        ; NodeDef: {{node Const}}; Op<name=Const; signature= -> output:dtype; attr=value:tensor; attr=dtype:type>
  at org.tensorflow.internal.c_api.AbstractTF_Status.throwExceptionIfNotOK(AbstractTF_Status.java:87)
  at org.tensorflow.EagerOperationBuilder.execute(EagerOperationBuilder.java:314)
  at org.tensorflow.EagerOperationBuilder.build(EagerOperationBuilder.java:77)
  at org.tensorflow.EagerOperationBuilder.build(EagerOperationBuilder.java:64)
  at org.tensorflow.op.core.Constant.create(Constant.java:1350)
  at org.tensorflow.op.core.Constant.tensorOf(Constant.java:521)
  at org.tensorflow.op.Ops.constant(Ops.java:1669)
  ... 59 elided

but if I filter some small part Dataframe is ok


scala> val featureVector = SparkConverter.sparkDataframeFeatureVectorConvertTfTensor(finalInputDf.filter(col("pay_status").equalTo(1)),"final_features" )
featureVector: org.tensorflow.ndarray.DoubleNdArray = org.tensorflow.ndarray.impl.dense.DoubleDenseNdArray@627077a

scala> val ft_small  = tf.constant(featureVector)
ft_small: org.tensorflow.op.core.Constant[org.tensorflow.types.TFloat64] = <Const 'Const_2'>

scala> ft_small.asTensor().numBytes()
res43: Long = 1058424696
Dominant language
Java
Stars
928
Forks
227
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tensorflow/java

All issues in tensorflow/java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.