zhanghang1989 / PyTorch-Encoding

A CV toolkit for my papers.
https://hangzhang.org/PyTorch-Encoding/
MIT License
2.04k stars 452 forks source link

Runtime Error: "ScaledL2_Forward_CUDA" not implemented for 'Half' #363

Closed gody7334 closed 3 years ago

gody7334 commented 3 years ago

I train the EncNet using Fastai, It OK witout mix percision training, when I add learn().to_fp16(), it give me this error,

Runtime Error: "ScaledL2_Forward_CUDA" not implemented for 'Half'

I saw pytorch apex lib just add modules into fp32 list, Any suggestion to add Hlaf to customed cuda operation?

Thanks.

zhanghang1989 commented 3 years ago

You may use this pure python implementation https://github.com/open-mmlab/mmsegmentation/blob/9f071cade8cdc59c13b416c7c9843005410c055c/mmseg/ops/encoding.py#L6

gody7334 commented 3 years ago

Thanks :+1:

gody7334 commented 3 years ago

Resolved