Open wszhengjx opened 2 years ago
What comment did you use? When I'm training,there is no argument pretrained
Hi, can you copy the whole error message including function call stacks? This is very limited information
I am also getting the same issue . @liuzhuang13 The error is . ` Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 66, in build_from_cfg return obj_cls(**args) TypeError: init() got an unexpected keyword argument 'pretrained'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 66, in build_from_cfg return obj_cls(*args) File "/content/mmsegmentation/mmseg/models/segmentors/encoder_decoder.py", line 36, in init self.backbone = builder.build_backbone(backbone) File "/content/mmsegmentation/mmseg/models/builder.py", line 20, in build_backbone return BACKBONES.build(cfg) File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 234, in build return self.build_func(args, **kwargs, registry=self) File "/usr/local/lib/python3.7/dist-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/usr/local/lib/python3.7/dist-packages/mmcv/utils/registry.py", line 69, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') TypeError: ConvNeXt: init() got an unexpected keyword argument 'pretrained'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/train.py", line 252, in
Just a guess... "Pretrained=True" is changing to "weights=ConvNeXt_Tiny_Weights.DEFAULT" in a new version of PyTorch.
For example:
from torchvision import models from torchvision.models import ConvNeXt_Tiny_Weights model_ft = models.convnext_tiny(weights=ConvNeXt_Tiny_Weights.DEFAULT)
See: https://pytorch.org/vision/main/models/generated/torchvision.models.convnext_tiny.html
Hope this helps.
Can you tell me the reason ,I will relly appreciate it !