Skip to content

Commit

Permalink
fix reported errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sanghyun-son committed Oct 19, 2018
1 parent 70294bb commit 075eeec
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -33,6 +33,7 @@ We provide scripts for reproducing all the results from our paper. You can train
* **imageio**
* matplotlib
* tqdm
* cv2 >= 3.xx (Only if you use video input/output)

**Recent updates**

Expand Down
5 changes: 4 additions & 1 deletion src/data/srdata.py
Expand Up @@ -77,7 +77,10 @@ def __init__(self, args, name='', train=True, benchmark=False):
if train:
n_patches = args.batch_size * args.test_every
n_images = len(args.data_train) * len(self.images_hr)
self.repeat = max(n_patches // n_images, 1)
if n_images == 0:
self.repeat = 0
else:
self.repeat = max(n_patches // n_images, 1)

# Below functions as used to prepare images
def _scan(self):
Expand Down
2 changes: 1 addition & 1 deletion src/main.py
Expand Up @@ -6,12 +6,12 @@
import loss
from option import args
from trainer import Trainer
from videotester import VideoTester

torch.manual_seed(args.seed)
checkpoint = utility.checkpoint(args)

if args.data_test == 'video':
from videotester import VideoTester
model = model.Model(args, checkpoint)
t = VideoTester(args, model, checkpoint)
t.test()
Expand Down
2 changes: 1 addition & 1 deletion src/option.py
Expand Up @@ -114,7 +114,7 @@
help='optimizer to use (SGD | ADAM | RMSprop)')
parser.add_argument('--momentum', type=float, default=0.9,
help='SGD momentum')
parser.add_argument('--beta', type=tuple, default=(0.9, 0.999),
parser.add_argument('--betas', type=tuple, default=(0.9, 0.999),
help='ADAM beta')
parser.add_argument('--epsilon', type=float, default=1e-8,
help='ADAM epsilon for numerical stability')
Expand Down
2 changes: 1 addition & 1 deletion src/utility.py
Expand Up @@ -192,7 +192,7 @@ def make_optimizer(args, my_model):
elif args.optimizer == 'ADAM':
optimizer_function = optim.Adam
kwargs = {
'betas': args.beta,
'betas': args.betas,
'eps': args.epsilon
}
elif args.optimizer == 'RMSprop':
Expand Down

0 comments on commit 075eeec

Please sign in to comment.