Topic 1 Question 15
You have been asked to develop an input pipeline for an ML training model that processes images from disparate sources at a low latency. You discover that your input data does not fit in memory. How should you create a dataset following Google-recommended best practices?
Create a tf.data.Dataset.prefetch transformation.
Convert the images to tf.Tensor objects, and then run Dataset.from_tensor_slices().
Convert the images to tf.Tensor objects, and then run tf.data.Dataset.from_tensors().
Convert the images into TFRecords, store the images in Cloud Storage, and then use the tf.data API to read the images for training.
ユーザの投票
コメント(17)
Should be D
👍 18chohan2021/06/15My option is D.
Cite from Google Pag: to construct a Dataset from data in memory, use tf.data.Dataset.from_tensors() or tf.data.Dataset.from_tensor_slices(). When input data is stored in a file (not in memory), the recommended TFRecord format, you can use tf.data.TFRecordDataset().
tf.data.Dataset is for data in memory. tf.data.TFRecordDataset is for data in non-memory storage.
👍 10alphard2021/12/07TFRecord for non-memeory
👍 4stefant2022/01/19
シャッフルモード