如何在自己的电脑上运行您的代码
minchicken opened this issue · 1 comments
尊敬的作者,您好,我是一个研0的新生,老师让我用您的代码去实现特征提取和故障分类,但是我下载您的代码在pycharm上运行时发现有错误,错误如下所示,请问这种错误应该如何解决
D:\anaconda3\envs\pytorch\python.exe F:\算法总结\特征提取\InceptionNext\inceptionnext-main\models\inceptionnext.py
Traceback (most recent call last):
File "F:\算法总结\特征提取\InceptionNext\inceptionnext-main\models\inceptionnext.py", line 12, in
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
File "D:\anaconda3\envs\pytorch\Lib\site-packages\timm_init_.py", line 2, in
from .models import create_model, list_models, is_model, list_modules, model_entrypoint,
File "D:\anaconda3\envs\pytorch\Lib\site-packages\timm\models_init_.py", line 28, in
from .maxxvit import *
File "D:\anaconda3\envs\pytorch\Lib\site-packages\timm\models\maxxvit.py", line 216, in
@DataClass
^^^^^^^^^
File "D:\anaconda3\envs\pytorch\Lib\dataclasses.py", line 1230, in dataclass
return wrap(cls)
^^^^^^^^^
File "D:\anaconda3\envs\pytorch\Lib\dataclasses.py", line 1220, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\envs\pytorch\Lib\dataclasses.py", line 958, in _process_class
cls_fields.append(_get_field(cls, name, type, kw_only))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\envs\pytorch\Lib\dataclasses.py", line 815, in _get_field
raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'timm.models.maxxvit.MaxxVitConvCfg'> for field conv_cfg is not allowed: use default_factory
Hi @minchicken,
Could you please check whether your Timm version is 0.6.11 or not?