backstopmedia / tensorflowbook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The memory of the TensorFlow node object could not be reclaimed

joylibo opened this issue · comments

commented

When I try to ran the code Chapter 5 - 05 CNN Implementation.ipynb. I noticed that the memory of the TensorFlow node object could not be reclaimed(For example image_file = tf.read_file(image_filename)), and as the for loop in the write_records_file method deepened, the python program took more and more memory, causing me to fail to write all the converted Picture file. What is your solution to this problem?

commented

I have solved this problem by

for breed, image_filenames in dataset.items():
        g = tf.Graph()
        with g.as_default():
        ...