examples icon indicating copy to clipboard operation
examples copied to clipboard

Support FP16(amp) in imagenet main.py

Open Deeeerek opened this issue 3 years ago • 2 comments

I am running test under : https://github.com/pytorch/examples/tree/main/imagenet

Does the main.py support FP16(amp)?like arguments: --amp

Thx

Deeeerek avatar Aug 16 '22 07:08 Deeeerek

@Deeeerek No. There was a try in https://github.com/pytorch/examples/pull/203 I think it should be easier and cleaner to support fp16 nowadays with amp from pytorch: https://pytorch.org/blog/accelerating-training-on-nvidia-gpus-with-pytorch-automatic-mixed-precision/ Please feel free to contribute if you like!

hudeven avatar Aug 16 '22 21:08 hudeven

Yes, I did it (amp) with autocast, GradScaler, much thx!

Deeeerek avatar Nov 28 '22 10:11 Deeeerek