Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemelas committed Nov 8, 2020
1 parent 6c15c19 commit 8ec2cab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pytorch_pretrained_vit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__version__ = "0.0.6"
__version__ = "0.0.7"

from .model import ViT
from .configs import *
from .utils import load_pretrained_weights
from .utils import load_pretrained_weights
2 changes: 2 additions & 0 deletions pytorch_pretrained_vit/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""utils.py - Helper functions
"""

import numpy as np
import torch
from torch.utils import model_zoo

Expand Down Expand Up @@ -107,6 +108,7 @@ def resize_positional_embedding_(posemb, posemb_new, has_class_token=True):
zoom_factor = (gs_new / gs_old, gs_new / gs_old, 1)
posemb_grid = zoom(posemb_grid, zoom_factor, order=1)
posemb_grid = posemb_grid.reshape(1, gs_new * gs_new, -1)
posemb_grid = torch.from_numpy(posemb_grid)

# Deal with class token and return
posemb = torch.cat([posemb_tok, posemb_grid], dim=1)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
EMAIL = 'luke.melas@gmail.com'
AUTHOR = 'Luke'
REQUIRES_PYTHON = '>=3.5.0'
VERSION = '0.0.6'
VERSION = '0.0.7'

# What packages are required for this module to be executed?
REQUIRED = [
Expand Down

0 comments on commit 8ec2cab

Please sign in to comment.