How to use TfRecordDataset DatasetToTfRecord tf.io.tfRecordReader
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- java, tensorflow
- Domain
- data, machine-learning
Research direction
Start with the TfRecordDataset, DatasetToTfRecord, and tf.io.tfRecordReader entry points shown in the issue, and compare their Java APIs with the requested Python usage. Done means providing a working tensorflow-java example that reads TFRecord data and explains how these APIs are used.
Written by the indexing model from the issue text.
Description
tensorflow-java 0.4
spark 3.1
java 11
Hi :
Now I use tensorflow-java to read tfrecord file ,but can not get the data, and our not have example for it ,the TfRecordDataset DatasetToTfRecord tf.io.tfRecordReader java class have not same api like python ,could we give some example for how to use them. thank
import org.tensorflow.{Operand, Session,EagerSession}
import org.tensorflow.op.Ops
import org.tensorflow.op.data.TfRecordDataset
import org.tensorflow.op.data.{DatasetToTfRecord, TfRecordDataset}
val session = EagerSession.create
val tf = Ops.create(session)
val scope = tf.scope()
// val fileName =tf.constant( "/Users/zhanghaining/Downloads/tfrecord-kk2-test/")
val fileName = tf.constant("/Users/zhanghaining/Downloads/BigDL/spark/dl/src/test/resources/tf/mnist_train.tfrecord")
val compress = tf.constant("")
val bufferSize = tf.constant(0l)
val recordDataSet = TfRecordDataset.create(scope,fileName,compress,bufferSize)
val record = DatasetToTfRecord.create(scope, recordDataSet,fileName,compress)
val reader = tf.io.tfRecordReader()
println(record.op().name() )
println(record.op().`type`())
println(recordDataSet.op().numOutputs() )
println(recordDataSet.asOutput().dataType())
- Dominant language
- Java
- Stars
- 928
- Forks
- 227
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tensorflow/java
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tensorflow/java#653 · 1 comment · 4 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tensorflow/java#621 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tensorflow/java#617 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
tensorflow/java#615 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tensorflow/java#614 · 1 comment ·
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100