Fix eval frequency

Former-commit-id: 1c6a9505c964fdd1bc7d55887725551afc94b956
This commit is contained in:
milesial 2020-06-11 20:53:00 -07:00 committed by GitHub
parent fb5f60fb31
commit 63f889a4b0

View file

@ -89,7 +89,7 @@ def train_net(net,
pbar.update(imgs.shape[0])
global_step += 1
if global_step % (len(dataset) // (10 * batch_size)) == 0:
if global_step % (n_train // (10 * batch_size)) == 0:
for tag, value in net.named_parameters():
tag = tag.replace('.', '/')
writer.add_histogram('weights/' + tag, value.data.cpu().numpy(), global_step)