zizhaozhang / unet-tensorflow-keras

A concise code for training and evaluating Unet using tensorflow+keras
MIT License
186 stars 72 forks source link

Efficiency issue #12

Open LLCF opened 6 years ago

LLCF commented 6 years ago
 x_batch, y_batch = next(train_generator)
 feed_dict = {   img: x_batch,
                        label: y_batch
                    }

This way is very slowly.

abin24 commented 6 years ago

It is slow because of the memory leak of the line: global_step.assign(it).eval() this line can be deleted!!!!

LLCF commented 6 years ago

I don't think so. When I comment "global_step.assign(it).eval()", most of the time, the GPU-Util is also 0%. I am sure that the GPU is waiting for data.

abin24 commented 6 years ago

Ok, I don't know what happened. I just add line sess.graph.finalize() after the line sess.run(init_op). and comment "global_step.assign(it).eval()" The train time is 4~5 faster than the original version. BTW, the original version will get 2~3times slower after about 1-2 hour

duyanfang123 commented 5 years ago

I want to ask where is the train data and test data???I am very urgent