79601816

Date: 2025-05-01 12:06:18
Score: 4.5
Natty:
Report link

I have another question about a memory leak.

After predicting labels, the memory is never released—even after the function finishes executing.

What should I do? I tried the following code, but it didn't work.

I use CPU and don't have any gpu.

import gc

tf.keras.backend.clear_session()
del predictions
gc.collect() 
Reasons:
  • Blacklisted phrase (1): another question
  • Blacklisted phrase (2): What should I do
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Azin Ekrami