1adrianb / 1adrianb/video-transformers
Error when build model
- Vorherrschende Sprache
- Python
- Sterne
- 47
- Forks
- 7
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
**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
main()
File "tools/run_net.py", line 30, in main
launch_job(cfg=cfg, init_method=args.init_method, func=train)
File "/mnt/lustre/sunweixuan/video-transformers/./slowfast/utils/misc.py", line 259, in launch_job
torch.multiprocessing.spawn(
File "/mnt/lustre/sunweixuan/anaconda3/envs/video/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 230, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/mnt/lustre/sunweixuan/anaconda3/envs/video/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
while not context.join():
File "/mnt/lustre/sunweixuan/anaconda3/envs/video/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 150, in join
raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException:
-- 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?**
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
The error occurs in ./slowfast/models/transformers/vit.py at line 469, where a call to create_model passes an unexpected 'default_cfg' argument. Check the timm library version used in the project's dependencies (e.g., requirements.txt or setup.py) and compare with the function signature in timm's factory.py and helpers.py. Look for recent changes in the timm API that might have removed or renamed this parameter. Running a version check and testing with different timm versions locally would be the first step.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, pytorch
- Bereich
- ai, machine-learning
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100