Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
09c5ddd6
Unverified
Commit
09c5ddd6
authored
Jan 17, 2022
by
Vasilis Vryniotis
Committed by
GitHub
Jan 17, 2022
Browse files
Adding missing named param check on ViT (#5196)
parent
f9bee391
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
torchvision/prototype/models/vision_transformer.py
torchvision/prototype/models/vision_transformer.py
+4
-1
No files found.
torchvision/prototype/models/vision_transformer.py
View file @
09c5ddd6
...
...
@@ -11,7 +11,7 @@ from torchvision.transforms.functional import InterpolationMode
from
...models.vision_transformer
import
VisionTransformer
,
interpolate_embeddings
# noqa: F401
from
._api
import
WeightsEnum
,
Weights
from
._meta
import
_IMAGENET_CATEGORIES
from
._utils
import
handle_legacy_interface
from
._utils
import
handle_legacy_interface
,
_ovewrite_named_param
__all__
=
[
"VisionTransformer"
,
...
...
@@ -111,6 +111,9 @@ def _vision_transformer(
)
->
VisionTransformer
:
image_size
=
kwargs
.
pop
(
"image_size"
,
224
)
if
weights
is
not
None
:
_ovewrite_named_param
(
kwargs
,
"num_classes"
,
len
(
weights
.
meta
[
"categories"
]))
model
=
VisionTransformer
(
image_size
=
image_size
,
patch_size
=
patch_size
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment