In tensorflow 2.0.0, this will work:
import tensorflow as tf
raw_dataset = tf.data.TFRecordDataset("input_file.tfrecord")
shards = 10
for i in range(shards):
writer = tf.data.experimental.TFRecordWriter(f"output_file-part-{i}.tfrecord")
writer.write(raw_dataset.shard(shards, i))
More Related Contents:
- Numpy to TFrecords: Is there a more simple way to handle batch inputs from tfrecords?
- Is there a simpler way to handle batch inputs from tfrecords?
- how to convert numpy to tfrecords and then generate batches?
- TensorFlow: training on my own image
- Tensorflow : logits and labels must have the same first dimension
- Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
- How to tell if tensorflow is using gpu acceleration from inside python shell?
- Using a pre-trained word embedding (word2vec or Glove) in TensorFlow
- Tensorflow – ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float)
- What is the difference between ‘SAME’ and ‘VALID’ padding in tf.nn.max_pool of tensorflow?
- Could not find a version that satisfies the requirement tensorflow
- Tensorflow read images with labels
- TensorFlow version 1.0.0-rc2 on Windows: “OpKernel (‘op: “BestSplits” device_type: “CPU”‘) for unknown op: BestSplits” with test code
- Which seeds have to be set where to realize 100% reproducibility of training results in tensorflow?
- Difference between Variable and get_variable in TensorFlow
- Tensorflow: How to get a tensor by name?
- TypeError: __array__() takes 1 positional argument but 2 were given (Image classification Keras)
- Tensorflow 2.0 – AttributeError: module ‘tensorflow’ has no attribute ‘Session’
- “zsh: illegal hardware instruction python” when installing Tensorflow on macbook pro M1 [duplicate]
- Illegal instruction (core dumped) after running import tensorflow
- ‘Library not loaded: @rpath/libcudart.7.5.dylib’ TensorFlow Error on Mac
- Why is Tensorflow not recognizing my GPU after conda install?
- Keras: .predict returns percentages instead of classes
- Keras Custom loss function to pass arguments other than y_true and y_pred
- Unknown initializer: GlorotUniform when loading Keras model
- Cartesian Product in Tensorflow
- How to fix “AttributeError: module ‘tensorflow’ has no attribute ‘get_default_graph'”?
- What is right batch normalization function in Tensorflow?
- How do I plot a Keras/Tensorflow subclassing API model?
- Strange behaviour of the loss function in keras model, with pretrained convolutional base