mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
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 fix
This commit is contained in:
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…
x
Reference in New Issue
Block a user