Commit e05735e9 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

mem monitoring

parent cdbbdbf4
......@@ -113,7 +113,7 @@ class AddNoise(object):
# Todo Downsample if needed
# if sample_rate > fs:
#
noise = normalize(noise)
noises.append(noise.squeeze()[:, None])
......
......@@ -421,7 +421,7 @@ def xtrain(speaker_number,
:param num_thread:
:return:
"""
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Start from scratch
if model_name is None:
......@@ -463,6 +463,22 @@ def xtrain(speaker_number,
print("Train on a single GPU")
model.to(device)
if device.type == 'cuda':
print(torch.cuda.get_device_name())
print('Memory Usage:')
print('Allocated:', round(torch.cuda.memory_allocated()/1024**3,1), 'GB')
print('Cached: ', round(torch.cuda.memory_cached()/1024**3,1), 'GB')
test = torch.tensor(numpy.ones((128, 16000 * 5), dtype=numpy.float32))
test.to(device)
if device.type == 'cuda':
print(torch.cuda.get_device_name())
print('Memory Usage:')
print('Allocated:', round(torch.cuda.memory_allocated()/1024**3,1), 'GB')
print('Cached: ', round(torch.cuda.memory_cached()/1024**3,1), 'GB')
"""
Set the dataloaders according to the dataset_yaml
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment