train.py - add with torch.no_grad():

This commit is contained in:
Eren Golge 2018-05-10 16:44:37 -07:00
parent 7c40455edd
commit b4bd713581
1 changed files with 33 additions and 32 deletions

View File

@ -191,6 +191,7 @@ def evaluate(model, criterion, data_loader, current_step):
print(" | > Validation")
progbar = Progbar(len(data_loader.dataset) / c.batch_size)
n_priority_freq = int(3000 / (c.sample_rate * 0.5) * c.num_freq)
with torch.no_grad():
for num_iter, data in enumerate(data_loader):
start_time = time.time()