[tensorflow] How to load a mini-batch from tfrecord and feed it to CNN ** tfrecord 파일로 부터 random mini-batch 만들고 CNN에 feed_dict 형식으로 입력 ** step1) load a mini-batch from tfrecord by tf.train.shuffle_batch()step2) use tf.placeholder_with_default() to convert the tensor (of size mini_batch_size) to numpy array // PSEUDO CODE ///////////////////////////////////import tensorflow as tfimport osimport numpy as npimport network as net def _get_image_and_label(param): ## dir.. 더보기 [tensorflow] How to random flip an image and its corresponding label ** tensorflow graph에서 영상과 해당 label 값을 동시에 random filp ** import tensorflow as tfimport osimport numpy as npimport network as net def _do_nothing(image, label): return image, label def _random_true_false(): prob = tf.random_uniform(shape=[], minval=0., maxval=1., dtype=tf.float32) predicate = tf.less(prob, 0.5) return predicate def _image_and_label_flip(image, label): image_flip = tf.image.flip_l.. 더보기 [tensorflow] How to make tfrecord file for training ** training data image들로 부터 tfrecord 만들기 ** ** Assume you have saved 100 images at 'file_path'. The corresponding labels are stored in label.csv file. That is, one integer value label per RGB image. // PSEUDO CODE //////////////////////////////////////import tensorflow as tfimport something def _bytes_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) def _int6.. 더보기 이전 1 ··· 60 61 62 63 64 65 66 다음