yama
yama

Reputation: 17

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

Upvotes: 1

Views: 273

Answers (1)

J_H
J_H

Reputation: 20425

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

import psutil

mem = psutil.virtual_memory()
print(mem)

Upvotes: 1

Related Questions