tfrecord

extracting numpy value from tensorflow object during transformation

旧时模样 提交于 2021-02-10 05:13:14
问题 i am trying to get word embeddings using tensorflow, and i have created adjacent work lists using my corpus. Number of unique words in my vocab are 8000 and number of adjacent word lists are around 1.6 million Word Lists sample photo Since the data is very large i am trying to write the word lists in batches to TFRecords file. def save_tfrecords_wordlist(toprocess_word_lists, path ): writer = tf.io.TFRecordWriter(path) for word_list in toprocess_word_lists: features=tf.train.Features( feature

extracting numpy value from tensorflow object during transformation

醉酒当歌 提交于 2021-02-10 05:07:38
问题 i am trying to get word embeddings using tensorflow, and i have created adjacent work lists using my corpus. Number of unique words in my vocab are 8000 and number of adjacent word lists are around 1.6 million Word Lists sample photo Since the data is very large i am trying to write the word lists in batches to TFRecords file. def save_tfrecords_wordlist(toprocess_word_lists, path ): writer = tf.io.TFRecordWriter(path) for word_list in toprocess_word_lists: features=tf.train.Features( feature

How to read (decode) .tfrecords file, see the images inside and do augmentation?

孤人 提交于 2021-01-29 02:40:22
问题 I have a .tfrecords file and I want to extract, see the images in the file and augment them. I am using https://colab.research.google.com TensorFlow version: 2.3.0 And for the following code raw_dataset = tf.data.TFRecordDataset("*path.tfrecords") for raw_record in raw_dataset.take(1): example = tf.train.Example() example.ParseFromString(raw_record.numpy()) print(example) I am facing the following output: features { feature { key: "depth" value { int64_list { value: 3 } } } feature { key:

Loading TF Records into Keras

旧时模样 提交于 2021-01-28 13:50:54
问题 I am trying to load a custom TFRecord file into my keras model. I attempted to follow this tutorial: https://medium.com/@moritzkrger/speeding-up-keras-with-tfrecord-datasets-5464f9836c36, but adapting for my use. My goal is to have the functions work similar to ImageDataGenerator from Keras. I cannot use that function because I specific metadata from the images that the generator does not grab. I'm not including that metadata here because I just need the basic network to function first. I

Using Instance Keys for Batch Prediction w/Tensorflow

*爱你&永不变心* 提交于 2021-01-28 06:08:31
问题 I am trying to figure out how to do batch prediction using Google Cloud. Specifically, I'm looking to do object detection, getting from a faster-RCNN tensorflow ckpt to a graph/saved model. My issue is that I need to be able to recover some kind of ID for my input images, perhaps an index or a filename. I'm not entirely sure how to do this in my situation, since this link mentions using instance keys, and the only relevant examples I've found regarding instance keys use JSON as the input

How to get original string data back from TFRecordData

和自甴很熟 提交于 2021-01-20 10:34:20
问题 I followed Tensorflow guide to save my string data using: def _create_string_feature(values): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[values.encode('utf-8')])) I also used ["tf.string", "FixedLenFeature"] as my feature original type, and "tf.string" as my feature convert type. However, during my training when I run my session and I create iterators, my string feature for a batch size of 2 (for example: ['food fruit', 'cupcake food' ]) would be like below. The problem is

tfRecords shown faulty in TF2

筅森魡賤 提交于 2020-12-05 11:38:54
问题 I have a couple of own tfrecord file made by myself. They are working perfectly in tf1, I used them in several projects. However if i want to use them in Tensorflow Object Detection API with tf2 (running the model_main_tf2.py script), I see the following in tensorboard: tensorboard images tab It totally masses up the images. (Running the /work/tfapi/research/object_detection/model_main.py script or even legacy_train and they looks fine) Is tf2 using different kind of encoding in tfrecords? Or

TFrecords occupy more space than original JPEG images

三世轮回 提交于 2020-08-25 03:53:51
问题 I'm trying to convert my Jpeg image set into to TFrecords. But TFrecord file is taking almost 5x more space than the image set. After a lot of googling, I learned that when JPEG are written into TFrecords, they aren't JPEG anymore. However I haven't come across an understandable code solution to this problem. Please tell me what changes ought to be made in the code below to write JPEG to Tfrecords. def print_progress(count, total): pct_complete = float(count) / total msg = "\r- Progress: {0:

TFrecords occupy more space than original JPEG images

本秂侑毒 提交于 2020-08-25 03:53:47
问题 I'm trying to convert my Jpeg image set into to TFrecords. But TFrecord file is taking almost 5x more space than the image set. After a lot of googling, I learned that when JPEG are written into TFrecords, they aren't JPEG anymore. However I haven't come across an understandable code solution to this problem. Please tell me what changes ought to be made in the code below to write JPEG to Tfrecords. def print_progress(count, total): pct_complete = float(count) / total msg = "\r- Progress: {0:

TFrecords occupy more space than original JPEG images

廉价感情. 提交于 2020-08-25 03:53:26
问题 I'm trying to convert my Jpeg image set into to TFrecords. But TFrecord file is taking almost 5x more space than the image set. After a lot of googling, I learned that when JPEG are written into TFrecords, they aren't JPEG anymore. However I haven't come across an understandable code solution to this problem. Please tell me what changes ought to be made in the code below to write JPEG to Tfrecords. def print_progress(count, total): pct_complete = float(count) / total msg = "\r- Progress: {0: