You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is a perfect project!
BUT!! I have some problem that i want to input [.jpg, .npy] as my input data format. (Because my training data is .jpg and .npy file)
I have traced code and found i can change the code of def load_examples .
I also survey how to use tf.train.slice_input_producer to load two data at the same time.
SO I try to revise the code bellow:
from original code with tf.name_scope("load_images"): path_queue = tf.train.string_input_producer(input_paths, shuffle=a.mode == "train") reader = tf.WholeFileReader() paths, contents = reader.read(path_queue) raw_input = decode(contents) raw_input = tf.image.convert_image_dtype(raw_input, dtype=tf.float32) paths_batch, inputs_batch, targets_batch = tf.train.batch([paths, input_images, target_images], batch_size=a.batch_size)
to with tf.name_scope("load_images"): image_jpg_datas = io.imread(image_jpg_paths) anotherimage_npy_datas= np.load(anotherimage_npy_paths) path_queue = tf.train.slice_input_producer([image_jpg_datas, anotherimage_npy_datas], shuffle=a.mode == "train") inputs_batch, targets_batch = tf.train.batch(path_queue, batch_size=a.batch_size)
and when i change my code i found that it will almost out of memory and the code will be killed. (data is around 60k)
I have no idea how can i input .jpg and .npy data format at the same time successfully.
Does anyone have some advises?
Thank you very much ><
The text was updated successfully, but these errors were encountered:
Hi, this is a perfect project!
BUT!! I have some problem that i want to input [.jpg, .npy] as my input data format. (Because my training data is .jpg and .npy file)
I have traced code and found i can change the code of
def load_examples
.I also survey how to use
tf.train.slice_input_producer
to load two data at the same time.SO I try to revise the code bellow:
from original code
with tf.name_scope("load_images"):
path_queue = tf.train.string_input_producer(input_paths, shuffle=a.mode == "train")
reader = tf.WholeFileReader()
paths, contents = reader.read(path_queue)
raw_input = decode(contents)
raw_input = tf.image.convert_image_dtype(raw_input, dtype=tf.float32)
paths_batch, inputs_batch, targets_batch = tf.train.batch([paths, input_images, target_images], batch_size=a.batch_size)
to
with tf.name_scope("load_images"):
image_jpg_datas = io.imread(image_jpg_paths)
anotherimage_npy_datas= np.load(anotherimage_npy_paths)
path_queue = tf.train.slice_input_producer([image_jpg_datas, anotherimage_npy_datas], shuffle=a.mode == "train")
inputs_batch, targets_batch = tf.train.batch(path_queue, batch_size=a.batch_size)
and when i change my code i found that it will almost out of memory and the code will be killed. (data is around 60k)
I have no idea how can i input .jpg and .npy data format at the same time successfully.
Does anyone have some advises?
Thank you very much ><
The text was updated successfully, but these errors were encountered: