tbepler / topaz

Pipeline for particle picking in cryo-electron microscopy images using convolutional neural networks trained from positive and unlabeled examples. Also featuring micrograph and tomogram denoising with DNNs.
GNU General Public License v3.0
170 stars 62 forks source link

RuntimeWarning: overflow encountered in exp in training #64

Open huwjenkins opened 3 years ago

huwjenkins commented 3 years ago

Hi,

I see the following message printed to stderr when training. RuntimeWarning: overflow encountered in exp. This is reproducible with Topaz 0.2.4 on the test dataset.

Using numpy.seterr identifies this occurs here for scores < -88.7228 as then np.exp(-score) overflows float32.

https://github.com/tbepler/topaz/blob/11f7ecbdfedfd4820199d43571059de61748c17d/topaz/commands/train.py#L539

Is this an issue? Thanks.

tbepler commented 3 years ago

Thanks for pointing this out. It should be fixed, but won't cause any problems other than the annoying warning.

huwjenkins commented 3 years ago

Thanks for confirming it doesn't cause any problems! Fortunately the warning is only printed the first time it happens.