用法
__len__()
用法示例:
###:方法tf.keras.preprocessing.image.DirectoryIterator.__len__() 的實現:
def __len__(self):
return (self.n + self.batch_size - 1) // self.batch_size # round up
###:使用__len__()的方式如下:
obj = tf.keras.preprocessing.image.DirectoryIterator(directory, image_data_generator)
objLen = len(obj)
相關用法
- Python tf.keras.preprocessing.image.ImageDataGenerator用法及代碼示例
- Python tf.keras.preprocessing.image.smart_resize用法及代碼示例
- Python tf.keras.preprocessing.sequence.TimeseriesGenerator用法及代碼示例
- Python tf.keras.preprocessing.sequence.pad_sequences用法及代碼示例
- Python tf.keras.preprocessing.sequence.make_sampling_table用法及代碼示例
- Python tf.keras.preprocessing.text.text_to_word_sequence用法及代碼示例
- Python tf.keras.applications.inception_resnet_v2.preprocess_input用法及代碼示例
- Python tf.keras.metrics.Mean.merge_state用法及代碼示例
- Python tf.keras.layers.InputLayer用法及代碼示例
- Python tf.keras.callbacks.ReduceLROnPlateau用法及代碼示例
- Python tf.keras.layers.serialize用法及代碼示例
- Python tf.keras.metrics.Hinge用法及代碼示例
- Python tf.keras.experimental.WideDeepModel.compute_loss用法及代碼示例
- Python tf.keras.metrics.SparseCategoricalAccuracy.merge_state用法及代碼示例
- Python tf.keras.metrics.RootMeanSquaredError用法及代碼示例
- Python tf.keras.applications.resnet50.preprocess_input用法及代碼示例
- Python tf.keras.metrics.SparseCategoricalCrossentropy.merge_state用法及代碼示例
- Python tf.keras.metrics.sparse_categorical_accuracy用法及代碼示例
- Python tf.keras.layers.Dropout用法及代碼示例
- Python tf.keras.activations.softplus用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.keras.preprocessing.image.DirectoryIterator.__len__。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。