video-transformers
video-transformers copied to clipboard
Error when build model
Thanks for the great code, I got the following error message when doing the training:
`vit_base_patch16_224_in21k
=> base model: vit_base_patch16_224_in21k
default cfg {'url': 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-vitjx/jx_vit_base_patch16_224_in21k-e5005f0a.pth', 'num_classes': 21843, 'input_size': (3, 224, 224), 'pool_size': None, 'crop_pct': 0.9, 'interpolation': 'bicubic', 'mean': (0.5, 0.5, 0.5), 'std': (0.5, 0.5, 0.5), 'first_conv': 'patch_embed.proj', 'classifier': 'head'}
Traceback (most recent call last):
File "tools/run_net.py", line 45, in
-- Process 0 terminated with the following error: Traceback (most recent call last): File "/mnt/lustre/sunweixuan/anaconda3/envs/video/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap fn(i, *args) File "/mnt/lustre/sunweixuan/video-transformers/./slowfast/utils/multiprocessing.py", line 63, in run ret = func(cfg) File "/mnt/lustre/sunweixuan/video-transformers/tools/train_net.py", line 361, in train model = build_model(cfg) File "/mnt/lustre/sunweixuan/video-transformers/./slowfast/models/build.py", line 38, in build_model model = MODEL_REGISTRY.get(name)(cfg) File "/mnt/lustre/sunweixuan/video-transformers/./slowfast/models/video_model_builder.py", line 42, in init self._prepare_base_model(self.cfg.XVIT.BASE_MODEL) File "/mnt/lustre/sunweixuan/video-transformers/./slowfast/models/video_model_builder.py", line 107, in _prepare_base_model self.base_model = create_model( File "/mnt/lustre/sunweixuan/anaconda3/envs/video/lib/python3.8/site-packages/timm/models/factory.py", line 71, in create_model model = create_fn(pretrained=pretrained, pretrained_cfg=pretrained_cfg, **kwargs) File "/mnt/lustre/sunweixuan/video-transformers/./slowfast/models/transformers/vit.py", line 469, in vit_base_patch16_224_in21k model = _create_vision_transformer( File "/mnt/lustre/sunweixuan/video-transformers/./slowfast/models/transformers/vit.py", line 425, in _create_vision_transformer model = build_model_with_cfg( File "/mnt/lustre/sunweixuan/anaconda3/envs/video/lib/python3.8/site-packages/timm/models/helpers.py", line 523, in build_model_with_cfg model = model_cls(**kwargs) if model_cfg is None else model_cls(cfg=model_cfg, **kwargs) TypeError: init() got an unexpected keyword argument 'default_cfg'`
My guess is it is a timm version problem, I wonder what is your timm version?
I also encountered this error
I tried a few versions and found that timm = 0.4.12 worked