mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

float division by zero error for small network

Open caiqi opened this issue 8 years ago • 6 comments

https://github.com/apache/incubator-mxnet/blob/251ae71a20d8318ab20f4c19520f74b881fdf3ff/python/mxnet/callback.py#L159 For some very small network, (time.time() - self.tic) may be zero and throws division by zero error.

caiqi avatar Dec 17 '17 17:12 caiqi

hah, interesting

dongzhuoyao avatar Dec 18 '17 03:12 dongzhuoyao

I have the same issue. Can anyone answer my stackoverflow question https://stackoverflow.com/questions/48401060/mxnet-regression-divide-by-zero-error

kilanny avatar Jan 23 '18 12:01 kilanny

I found the cause of problem:

If I increase the value of 2nd parameter of Speedometer() function it works:

model.fit(train_iter, eval_iter, optimizer_params={'learning_rate':0.005, 'momentum': 0.9}, num_epoch=50, eval_metric='mse', batch_end_callback = mx.callback.Speedometer(batch_size, 50))

kilanny avatar Jan 23 '18 12:01 kilanny

Is this because our GPU based machine runs too fast?

I also encounter this problem when playing the linear regression toy network in https://mxnet.incubator.apache.org/tutorials/python/linear-regression.html.

zchrissirhcz avatar May 25 '18 13:05 zchrissirhcz

I think it is because the console, too much lines are being printed. Check out my stackoverflow question for details

kilanny avatar May 26 '18 14:05 kilanny

Resolving. Please reopen if issue still persists.

sandeep-krishnamurthy avatar May 26 '18 23:05 sandeep-krishnamurthy