Skip to content

Commit

Permalink
fix timm version compatibility (#331)
Browse files Browse the repository at this point in the history
* Fix timm version compatibility
  • Loading branch information
Cathy0908 authored Nov 1, 2023
1 parent 8c3ba59 commit fc16bc1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion easycv/models/backbones/efficientformer.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Copyright (c) 2022 Snap Inc. All rights reserved.
import itertools
import os
from distutils.version import LooseVersion

import timm
import torch
import torch.nn as nn
from timm.models.layers import DropPath, trunc_normal_
from timm.models.layers.helpers import to_2tuple

from ..modelzoo import efficientformer as model_urls
from ..registry import BACKBONES

if LooseVersion(timm.__version__) <= LooseVersion('0.8.2'):
from timm.models.layers.helpers import to_2tuple
else:
from timm.layers.helpers import to_2tuple


class Attention(torch.nn.Module):

Expand Down

0 comments on commit fc16bc1

Please sign in to comment.