mitmul / ssai-cnn

Semantic Segmentation for Aerial / Satellite Images with Convolutional Neural Networks including an unofficial implementation of Volodymyr Mnih's methods
http://www.ingentaconnect.com/content/ist/jist/2016/00000060/00000001/art00003
MIT License
260 stars 75 forks source link

Adam optimisation error #19

Closed Tejuwi closed 6 years ago

Tejuwi commented 6 years ago

Hi,

I am trying set Adam optimization algorithm but receiving the following error, can you please help me how to set parameters?

python3.5/site-packages/chainer-1.22.0-py3.5-linux-x86_64.egg/chainer/optimizers/adam.py", line 51, in lr return self.alpha * math.sqrt(fix2) / fix1 ZeroDivisionError: float division by zero

Please see the below parameters what i have set.

parser.add_argument('--opt', type=str, default='Adam', choices=['MomentumSGD', 'Adam', 'AdaGrad'])
parser.add_argument('--weight_decay', type=float, default=0.0001)
parser.add_argument('--alpha', type=float, default=0.001)
parser.add_argument('--lr', type=float, default=0.0001)
parser.add_argument('--lr_decay_freq', type=int, default=100)
parser.add_argument('--lr_decay_ratio', type=float, default=0.1)
parser.add_argument('--seed', type=int, default=1701)
args = parser.parse_args()

Thank you

niboshi commented 6 years ago

See also: https://github.com/chainer/chainer/issues/3921

I think this line should be fixed: https://github.com/mitmul/ssai-cnn/blob/fa8d21bc04e50c3cda8888916cc1c7a0e839f561/scripts/train.py#L312

Tejuwi commented 6 years ago

Thank you

Tejuwi commented 6 years ago

working now, thanks for your support