Update eva.py (#2058)
* Update eva.py When argument class token = False, self.cls_token = None. Prevents error from attempting trunc_normal_ on None: AttributeError: 'NoneType' object has no attribute 'uniform_' * Update eva.py fixpull/1974/merge
parent
7da34a999a
commit
e0079c92da
|
@ -479,7 +479,8 @@ class Eva(nn.Module):
|
|||
self.apply(self._init_weights)
|
||||
if self.pos_embed is not None:
|
||||
trunc_normal_(self.pos_embed, std=.02)
|
||||
trunc_normal_(self.cls_token, std=.02)
|
||||
if self.cls_token is not None:
|
||||
trunc_normal_(self.cls_token, std=.02)
|
||||
|
||||
self.fix_init_weight()
|
||||
if isinstance(self.head, nn.Linear):
|
||||
|
|
Loading…
Reference in New Issue