From a4823653b940482b553ae5e2fe02086847029b36 Mon Sep 17 00:00:00 2001 From: Claudiu Leoveanu Date: Wed, 1 Feb 2023 12:17:15 +0200 Subject: [PATCH] fixed import in python 3.11.0 --- timm/models/maxxvit.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/timm/models/maxxvit.py b/timm/models/maxxvit.py index bd529245..4312d3d3 100644 --- a/timm/models/maxxvit.py +++ b/timm/models/maxxvit.py @@ -39,7 +39,7 @@ Hacked together by / Copyright 2022, Ross Wightman import math from collections import OrderedDict -from dataclasses import dataclass, replace +from dataclasses import dataclass, replace, field from functools import partial from typing import Callable, Optional, Union, Tuple, List @@ -229,8 +229,8 @@ class MaxxVitCfg: block_type: Tuple[Union[str, Tuple[str, ...]], ...] = ('C', 'C', 'T', 'T') stem_width: Union[int, Tuple[int, int]] = 64 stem_bias: bool = True - conv_cfg: MaxxVitConvCfg = MaxxVitConvCfg() - transformer_cfg: MaxxVitTransformerCfg = MaxxVitTransformerCfg() + conv_cfg: MaxxVitConvCfg = field(default_factory=MaxxVitConvCfg) + transformer_cfg: MaxxVitTransformerCfg = field(default_factory=MaxxVitTransformerCfg) weight_init: str = 'vit_eff' @@ -1910,4 +1910,5 @@ def maxvit_large_224(pretrained=False, **kwargs): @register_model def maxvit_xlarge_224(pretrained=False, **kwargs): - return _create_maxxvit('maxvit_xlarge_224', pretrained=pretrained, **kwargs) \ No newline at end of file + return _create_maxxvit('maxvit_xlarge_224', pretrained=pretrained, **kwargs) +