mirror of https://github.com/JDAI-CV/fast-reid.git
fix arcface NaN problem
Summary: fix classifier init bugs, which will not initialize classifier weights when use arcface or circle loss. In this way, it will lead loss NaN problem.pull/150/head
parent
6623bff187
commit
3840f3f79a
|
@ -35,5 +35,5 @@ def weights_init_classifier(m):
|
|||
nn.init.normal_(m.weight, std=0.001)
|
||||
if m.bias is not None:
|
||||
nn.init.constant_(m.bias, 0.0)
|
||||
elif classname.find("Arcface") and classname.find("Circle") != -1:
|
||||
elif classname.find("Arcface") != -1 or classname.find("Circle") != -1:
|
||||
nn.init.kaiming_uniform_(m.weight, a=math.sqrt(5))
|
||||
|
|
Loading…
Reference in New Issue