LeeJunHyun / Image_Segmentation

Pytorch implementation of U-Net, R2U-Net, Attention U-Net, and Attention R2U-Net.
2.68k stars 595 forks source link

lr is confusing #17

Closed zhaoxuyan closed 5 years ago

zhaoxuyan commented 5 years ago

When I run python main.py --lr=0.001 I saw this

Namespace(augmentation_prob=0.05992219405072973, batch_size=4, beta1=0.5, beta2=0.999, cuda_idx=2, image_size=224, img_ch=3, log_step=2, lr=0.0002124676041200755, mode='train', model_path='./models', model_type='R2AttU_Net', num_epochs=100, num_epochs_decay=24, num_workers=8, output_ch=1, result_path='./result/R2AttU_Net', t=3, test_path='./dataset/test/', train_path='./dataset/train/', val_step=2, valid_path='./dataset/valid/')

as you can see: lr=0.0002124676041200755 The learning rate is not equal as I set in the config, why? How can I deal with it? Thank you!

zhaoxuyan commented 5 years ago

I have found this lines:

lr = random.random()*0.0005 + 0.0000005
config.lr = lr

Is it wrong? I think it should be: config.lr = config.lr + lr

LeeJunHyun commented 5 years ago

Hi, @zhaoxuyan , The code for lr was for random hyperparameter search. You can remove them, then set hyperparameter that you want. Thank you for pointing this out!

zhaoxuyan commented 5 years ago

Thank you!