#๐Ÿ”’ How do I clear GPU cache (or something similar)?

11 messages ยท Page 1 of 1 (latest)

light zephyr
#

I'm extracting data from a pdf one page at a time and it crashes after like 4 pages

I can just save the data and [insert something like clear GPU memory here], but I don't know that step is

currently running torch.cuda.empty_cache() after each extraction, but I do not have a lot of luck with that.

(working in jupyter on a google compute VM running debian 12)

tight riverBOT
#

@light zephyr

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

shrewd flame
#

in addition to what you're already doing if you delete the object consuming memory then run garbage collection it should free up memory.

#

@light zephyr

light zephyr
#

ayyy thanks

shrewd flame
#

You're welcome. Does it help?

#

If your problem is solved you can close the thread by typing !close on a blank line.

light zephyr
#

dunno yet, might actually just be a RAM issue lol

tight riverBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.