From 2b6ef545b36e75500d897b9b915720cfe4b10a91 Mon Sep 17 00:00:00 2001 From: hanyang Date: Wed, 28 Oct 2020 21:16:34 +0800 Subject: [PATCH 1/2] import torch --- main.py | 4 ++-- utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index d9cf17ed0..8c92855a7 100644 --- a/main.py +++ b/main.py @@ -111,7 +111,7 @@ def train(epoch): % (train_loss/(batch_idx+1), 100.*correct/total, correct, total)) -def test(epoch): +def test_net(epoch): global best_acc net.eval() test_loss = 0 @@ -148,4 +148,4 @@ def test(epoch): for epoch in range(start_epoch, start_epoch+200): train(epoch) - test(epoch) + test_net(epoch) diff --git a/utils.py b/utils.py index 4c9b3f90c..c29742384 100644 --- a/utils.py +++ b/utils.py @@ -10,7 +10,7 @@ import torch.nn as nn import torch.nn.init as init - +import torch def get_mean_and_std(dataset): '''Compute the mean and std value of dataset.''' From 0931197fc077634c3d5b832caa91a6934e97f978 Mon Sep 17 00:00:00 2001 From: hanyang Date: Wed, 28 Oct 2020 21:44:24 +0800 Subject: [PATCH 2/2] add .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..cd754ee6b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pyc +data +__pycache__