简体   繁体   中英

Get memory usage after each training epoch - Tensorflow version 1.15

I am using code that requires tensorflow version 1.15.

However, I would like to record the amount of memory used after each training epoch of a BERT model. In tensorflow version 2, this can be achieved by tf.config.experimental.get_memory_usage . How could I do the same with version 1.15? If it's not a feature of tensorflow, is there another way I could record memory use after each epoch?

Thanks in advance and apologies if simple question - a beginner

EDIT: I am interested in GPU usage

Periodically call psutil to ask the OS about recent resource consumption.

import psutil

mem = psutil.virtual_memory()
print(mem)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM