Tensorflow memory leak in every iteration

前端 未结 1 1089
孤城傲影
孤城傲影 2021-01-20 20:53

I\'m trying to find out why the code below occurs a huge memory leak during iteration by iteration. Here\'s the whole code.

def train_network(file_folder, fi         


        
1条回答
  •  孤城傲影
    2021-01-20 21:43

    The reason is you create new tensorflow operations on every session call.

    Move these two out of for loop tf.gather(class_logit, 0), tf.gather(highlight_logit, 0), and problem should gone.

    0 讨论(0)
提交回复
热议问题