Closed blazejdolicki closed 2 years ago
Hey @blazejdolicki, Have you looked at this tutorial and cross-referenced your config with it? You should have LINEAR_EVAL_FEAT_POOL_OPS_MAP to be a list of the features that you want to extract. Now I'm not sure these options are supported for ViT.
One work around you could try is https://vissl.ai/tutorials/Feature_Extraction_V0_1_6#Extract-the-Output-of-the-Model-Head extracting the head features and either: 1) Creating an identity head. 2) Not setting the head in the model. You should also be able to hack around https://github.com/facebookresearch/vissl/blob/main/vissl/models/trunks/feature_extractor.py to save what you need -- I'd recommend taking a debugger and walking through this code.
Thanks for your reply. Here's what I did. In this config file the Identity module is used to return the input without changing it.
LINEAR_EVAL_FEAT_POOL_OPS_MAP: [
["conv1", ["AvgPool2d", [[10, 10], 10, 4]]],
["res2", ["AvgPool2d", [[16, 16], 8, 0]]],
["res3", ["AvgPool2d", [[13, 13], 5, 0]]],
["res4", ["AvgPool2d", [[8, 8], 3, 0]]],
["res5", ["AvgPool2d", [[6, 6], 1, 0]]],
["res5avg", ["Identity", []]],
]
I suppose "res5avg" is the last layer in the CNN trunk. So I tried to replicate it for transformers, where the last layer in the trunk is norm
by adding the following to my config:
LINEAR_EVAL_FEAT_POOL_OPS_MAP: [
["norm", ["Identity", []]],
]
Do you think this solution will return correct features? Running with this config does not lead to any errors, the number of returned features corresponds to the number of images in the supplied dataset and the shape of the features are correct. But I'm still thinking how can I verify that the values of the features are correct. So far the only way to confirm that which I came up with is to load the model in plain PyTorch and see if its returned features match with those returned by VISSL. Is there a better way to do it?
That sounds like a good plan to me!
You could also step through the vissl code with a debugger to make sure it's returning the right thing. I will try to validate quickly later this as well.
If you wanted to contribute a config in a PR with these options so we have this use-case documented that would be amazing!
Hi @iseessel, took me some time but I added a pull request with my config. Just signed the CLA, so that should be updated soon. Thanks for all the help!
If you do not know the root cause of the problem, and wish someone to help you, please post according to this template:
Instructions To Reproduce the Issue:
Check https://stackoverflow.com/help/minimal-reproducible-example for how to ask good questions. Simplify the steps to reproduce the issue using suggestions from the above link, and provide them below:
git diff
)I didn't write any code.
what exact command you run: I'm running this command:
$CONFIG_PATH
leads to a .yaml config file with the following content:while
$MODEL_WEIGHTS
refers to a .torch file with a DINO model pretrained with VISSL.CPU info:
Architecture x86_64 CPU op-mode(s) 32-bit, 64-bit Byte Order Little Endian CPU(s) 24 On-line CPU(s) list 0-23 Thread(s) per core 1 Core(s) per socket 12 Socket(s) 2 NUMA node(s) 4 Vendor ID GenuineIntel CPU family 6 Model 85 Model name Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz Stepping 4 CPU MHz 999.885 BogoMIPS 4600.00 Virtualization VT-x L1d cache 32K L1i cache 32K L2 cache 1024K L3 cache 16896K NUMA node0 CPU(s) 0,4,8,12,16,20 NUMA node1 CPU(s) 1,5,9,13,17,21 NUMA node2 CPU(s) 2,6,10,14,18,22 NUMA node3 CPU(s) 3,7,11,15,19,23
INFO 2021-12-20 16:15:53,827 trainer_main.py: 112: Using Distributed init method: tcp://localhost:38853, world_size: 1, rank: 0 INFO 2021-12-20 16:15:53,835 distributed_c10d.py: 187: Added key: store_based_barrier_key:1 to store for rank: 0 INFO 2021-12-20 16:15:53,835 trainer_main.py: 130: | initialized host r28n5.lisa.surfsara.nl as rank 0 (0) INFO 2021-12-20 16:16:07,923 train_task.py: 182: Not using Automatic Mixed Precision INFO 2021-12-20 16:16:07,926 ssl_dataset.py: 156: Rank: 0 split: TEST Data files: [''] INFO 2021-12-20 16:16:07,926 ssl_dataset.py: 159: Rank: 0 split: TEST Label files: [] INFO 2021-12-20 16:16:07,926 ssl_dataset.py: 156: Rank: 0 split: TRAIN Data files: [''] INFO 2021-12-20 16:16:07,926 ssl_dataset.py: 159: Rank: 0 split: TRAIN Label files: [] INFO 2021-12-20 16:16:07,926 misc.py: 141: Set start method of multiprocessing to forkserver INFO 2021-12-20 16:16:07,926 init.py: 130: Created the Distributed Sampler.... INFO 2021-12-20 16:16:07,926 init.py: 105: Distributed Sampler config: {'num_replicas': 1, 'rank': 0, 'epoch': 0, 'num_samples': 50000, 'total_size': 50000, 'shuffle': True, 'seed': 0} INFO 2021-12-20 16:16:07,926 init.py: 198: Prefetch factor is set to the default: 2 INFO 2021-12-20 16:16:07,927 init.py: 227: Wrapping the dataloader to async device copies INFO 2021-12-20 16:16:07,927 misc.py: 141: Set start method of multiprocessing to forkserver INFO 2021-12-20 16:16:07,927 init.py: 130: Created the Distributed Sampler.... INFO 2021-12-20 16:16:07,927 init.py: 105: Distributed Sampler config: {'num_replicas': 1, 'rank': 0, 'epoch': 0, 'num_samples': 50000, 'total_size': 50000, 'shuffle': True, 'seed': 0} INFO 2021-12-20 16:16:07,927 init.py: 198: Prefetch factor is set to the default: 2 INFO 2021-12-20 16:16:07,927 init.py: 227: Wrapping the dataloader to async device copies INFO 2021-12-20 16:16:07,927 train_task.py: 450: Building model.... INFO 2021-12-20 16:16:07,928 vision_transformer.py: 173: Building model: Vision Transformer from yaml config INFO 2021-12-20 16:16:08,671 train_task.py: 467: config.MODEL.FEATURE_EVAL_SETTINGS.FREEZE_TRUNK_ONLY=True, will freeze trunk... INFO 2021-12-20 16:16:08,671 base_ssl_model.py: 194: Freezing model trunk... INFO 2021-12-20 16:16:08,672 train_task.py: 424: Initializing model from: /hissl-logs/train_nct_dino/checkpoints/8521997/model_phase40.torch INFO 2021-12-20 16:16:08,672 util.py: 276: Attempting to load checkpoint from /hissl-logs/train_nct_dino/checkpoints/8521997/model_phase40.torch INFO 2021-12-20 16:16:09,304 util.py: 281: Loaded checkpoint from /hissl-logs/train_nct_dino/checkpoints/8521997/model_phase40.torch INFO 2021-12-20 16:16:09,304 util.py: 240: Broadcasting checkpoint loaded from /hissl-logs/train_nct_dino/checkpoints/8521997/model_phase40.torch INFO 2021-12-20 16:16:28,406 train_task.py: 430: Checkpoint loaded: /hissl-logs/train_nct_dino/checkpoints/8521997/model_phase40.torch... INFO 2021-12-20 16:16:28,408 checkpoint.py: 885: Loaded: trunk.class_token of shape: torch.Size([1, 1, 384]) from checkpoint INFO 2021-12-20 16:16:28,408 checkpoint.py: 885: Loaded: trunk.pos_embedding of shape: torch.Size([1, 197, 384]) from checkpoint INFO 2021-12-20 16:16:28,412 checkpoint.py: 885: Loaded: trunk.patch_embed.proj.weight of shape: torch.Size([384, 3, 16, 16]) from checkpoint INFO 2021-12-20 16:16:28,412 checkpoint.py: 885: Loaded: trunk.patch_embed.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,412 checkpoint.py: 885: Loaded: trunk.blocks.0.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,412 checkpoint.py: 885: Loaded: trunk.blocks.0.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,417 checkpoint.py: 885: Loaded: trunk.blocks.0.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,417 checkpoint.py: 885: Loaded: trunk.blocks.0.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,418 checkpoint.py: 885: Loaded: trunk.blocks.0.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,418 checkpoint.py: 885: Loaded: trunk.blocks.0.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,418 checkpoint.py: 885: Loaded: trunk.blocks.0.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,418 checkpoint.py: 885: Loaded: trunk.blocks.0.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,422 checkpoint.py: 885: Loaded: trunk.blocks.0.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,422 checkpoint.py: 885: Loaded: trunk.blocks.0.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,427 checkpoint.py: 885: Loaded: trunk.blocks.0.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,427 checkpoint.py: 885: Loaded: trunk.blocks.0.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,427 checkpoint.py: 885: Loaded: trunk.blocks.1.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,427 checkpoint.py: 885: Loaded: trunk.blocks.1.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,431 checkpoint.py: 885: Loaded: trunk.blocks.1.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,431 checkpoint.py: 885: Loaded: trunk.blocks.1.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,432 checkpoint.py: 885: Loaded: trunk.blocks.1.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,432 checkpoint.py: 885: Loaded: trunk.blocks.1.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,432 checkpoint.py: 885: Loaded: trunk.blocks.1.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,432 checkpoint.py: 885: Loaded: trunk.blocks.1.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,436 checkpoint.py: 885: Loaded: trunk.blocks.1.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,436 checkpoint.py: 885: Loaded: trunk.blocks.1.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,441 checkpoint.py: 885: Loaded: trunk.blocks.1.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,441 checkpoint.py: 885: Loaded: trunk.blocks.1.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,441 checkpoint.py: 885: Loaded: trunk.blocks.2.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,441 checkpoint.py: 885: Loaded: trunk.blocks.2.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,444 checkpoint.py: 885: Loaded: trunk.blocks.2.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,444 checkpoint.py: 885: Loaded: trunk.blocks.2.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,446 checkpoint.py: 885: Loaded: trunk.blocks.2.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,446 checkpoint.py: 885: Loaded: trunk.blocks.2.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,446 checkpoint.py: 885: Loaded: trunk.blocks.2.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,446 checkpoint.py: 885: Loaded: trunk.blocks.2.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,449 checkpoint.py: 885: Loaded: trunk.blocks.2.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,449 checkpoint.py: 885: Loaded: trunk.blocks.2.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,453 checkpoint.py: 885: Loaded: trunk.blocks.2.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,453 checkpoint.py: 885: Loaded: trunk.blocks.2.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,453 checkpoint.py: 885: Loaded: trunk.blocks.3.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,453 checkpoint.py: 885: Loaded: trunk.blocks.3.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,456 checkpoint.py: 885: Loaded: trunk.blocks.3.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,456 checkpoint.py: 885: Loaded: trunk.blocks.3.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,458 checkpoint.py: 885: Loaded: trunk.blocks.3.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,458 checkpoint.py: 885: Loaded: trunk.blocks.3.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,458 checkpoint.py: 885: Loaded: trunk.blocks.3.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,458 checkpoint.py: 885: Loaded: trunk.blocks.3.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,462 checkpoint.py: 885: Loaded: trunk.blocks.3.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,462 checkpoint.py: 885: Loaded: trunk.blocks.3.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,463 checkpoint.py: 885: Loaded: trunk.blocks.3.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,463 checkpoint.py: 885: Loaded: trunk.blocks.3.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,463 checkpoint.py: 885: Loaded: trunk.blocks.4.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,463 checkpoint.py: 885: Loaded: trunk.blocks.4.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,467 checkpoint.py: 885: Loaded: trunk.blocks.4.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,467 checkpoint.py: 885: Loaded: trunk.blocks.4.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,468 checkpoint.py: 885: Loaded: trunk.blocks.4.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,468 checkpoint.py: 885: Loaded: trunk.blocks.4.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,468 checkpoint.py: 885: Loaded: trunk.blocks.4.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,468 checkpoint.py: 885: Loaded: trunk.blocks.4.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,473 checkpoint.py: 885: Loaded: trunk.blocks.4.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,473 checkpoint.py: 885: Loaded: trunk.blocks.4.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,476 checkpoint.py: 885: Loaded: trunk.blocks.4.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,476 checkpoint.py: 885: Loaded: trunk.blocks.4.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,476 checkpoint.py: 885: Loaded: trunk.blocks.5.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,476 checkpoint.py: 885: Loaded: trunk.blocks.5.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,479 checkpoint.py: 885: Loaded: trunk.blocks.5.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,479 checkpoint.py: 885: Loaded: trunk.blocks.5.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,481 checkpoint.py: 885: Loaded: trunk.blocks.5.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,481 checkpoint.py: 885: Loaded: trunk.blocks.5.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,481 checkpoint.py: 885: Loaded: trunk.blocks.5.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,481 checkpoint.py: 885: Loaded: trunk.blocks.5.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,485 checkpoint.py: 885: Loaded: trunk.blocks.5.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,485 checkpoint.py: 885: Loaded: trunk.blocks.5.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,489 checkpoint.py: 885: Loaded: trunk.blocks.5.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,489 checkpoint.py: 885: Loaded: trunk.blocks.5.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,489 checkpoint.py: 885: Loaded: trunk.blocks.6.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,489 checkpoint.py: 885: Loaded: trunk.blocks.6.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,493 checkpoint.py: 885: Loaded: trunk.blocks.6.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,493 checkpoint.py: 885: Loaded: trunk.blocks.6.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,494 checkpoint.py: 885: Loaded: trunk.blocks.6.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,495 checkpoint.py: 885: Loaded: trunk.blocks.6.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,495 checkpoint.py: 885: Loaded: trunk.blocks.6.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,495 checkpoint.py: 885: Loaded: trunk.blocks.6.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,495 checkpoint.py: 885: Loaded: trunk.blocks.6.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,495 checkpoint.py: 885: Loaded: trunk.blocks.6.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,499 checkpoint.py: 885: Loaded: trunk.blocks.6.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,499 checkpoint.py: 885: Loaded: trunk.blocks.6.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,499 checkpoint.py: 885: Loaded: trunk.blocks.7.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,500 checkpoint.py: 885: Loaded: trunk.blocks.7.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,503 checkpoint.py: 885: Loaded: trunk.blocks.7.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,503 checkpoint.py: 885: Loaded: trunk.blocks.7.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,505 checkpoint.py: 885: Loaded: trunk.blocks.7.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,505 checkpoint.py: 885: Loaded: trunk.blocks.7.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,505 checkpoint.py: 885: Loaded: trunk.blocks.7.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,505 checkpoint.py: 885: Loaded: trunk.blocks.7.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,508 checkpoint.py: 885: Loaded: trunk.blocks.7.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,508 checkpoint.py: 885: Loaded: trunk.blocks.7.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,511 checkpoint.py: 885: Loaded: trunk.blocks.7.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,512 checkpoint.py: 885: Loaded: trunk.blocks.7.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,512 checkpoint.py: 885: Loaded: trunk.blocks.8.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,512 checkpoint.py: 885: Loaded: trunk.blocks.8.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,514 checkpoint.py: 885: Loaded: trunk.blocks.8.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,514 checkpoint.py: 885: Loaded: trunk.blocks.8.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,515 checkpoint.py: 885: Loaded: trunk.blocks.8.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,515 checkpoint.py: 885: Loaded: trunk.blocks.8.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,515 checkpoint.py: 885: Loaded: trunk.blocks.8.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,515 checkpoint.py: 885: Loaded: trunk.blocks.8.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,520 checkpoint.py: 885: Loaded: trunk.blocks.8.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,520 checkpoint.py: 885: Loaded: trunk.blocks.8.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,525 checkpoint.py: 885: Loaded: trunk.blocks.8.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,525 checkpoint.py: 885: Loaded: trunk.blocks.8.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,525 checkpoint.py: 885: Loaded: trunk.blocks.9.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,525 checkpoint.py: 885: Loaded: trunk.blocks.9.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,529 checkpoint.py: 885: Loaded: trunk.blocks.9.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,529 checkpoint.py: 885: Loaded: trunk.blocks.9.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,530 checkpoint.py: 885: Loaded: trunk.blocks.9.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,530 checkpoint.py: 885: Loaded: trunk.blocks.9.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,530 checkpoint.py: 885: Loaded: trunk.blocks.9.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,530 checkpoint.py: 885: Loaded: trunk.blocks.9.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,534 checkpoint.py: 885: Loaded: trunk.blocks.9.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,535 checkpoint.py: 885: Loaded: trunk.blocks.9.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,538 checkpoint.py: 885: Loaded: trunk.blocks.9.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,538 checkpoint.py: 885: Loaded: trunk.blocks.9.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,538 checkpoint.py: 885: Loaded: trunk.blocks.10.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,538 checkpoint.py: 885: Loaded: trunk.blocks.10.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,542 checkpoint.py: 885: Loaded: trunk.blocks.10.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,542 checkpoint.py: 885: Loaded: trunk.blocks.10.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,543 checkpoint.py: 885: Loaded: trunk.blocks.10.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,543 checkpoint.py: 885: Loaded: trunk.blocks.10.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,543 checkpoint.py: 885: Loaded: trunk.blocks.10.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,543 checkpoint.py: 885: Loaded: trunk.blocks.10.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,547 checkpoint.py: 885: Loaded: trunk.blocks.10.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,547 checkpoint.py: 885: Loaded: trunk.blocks.10.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,550 checkpoint.py: 885: Loaded: trunk.blocks.10.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,551 checkpoint.py: 885: Loaded: trunk.blocks.10.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,551 checkpoint.py: 885: Loaded: trunk.blocks.11.norm1.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,551 checkpoint.py: 885: Loaded: trunk.blocks.11.norm1.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,554 checkpoint.py: 885: Loaded: trunk.blocks.11.attn.qkv.weight of shape: torch.Size([1152, 384]) from checkpoint INFO 2021-12-20 16:16:28,554 checkpoint.py: 885: Loaded: trunk.blocks.11.attn.qkv.bias of shape: torch.Size([1152]) from checkpoint INFO 2021-12-20 16:16:28,555 checkpoint.py: 885: Loaded: trunk.blocks.11.attn.proj.weight of shape: torch.Size([384, 384]) from checkpoint INFO 2021-12-20 16:16:28,555 checkpoint.py: 885: Loaded: trunk.blocks.11.attn.proj.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,555 checkpoint.py: 885: Loaded: trunk.blocks.11.norm2.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,555 checkpoint.py: 885: Loaded: trunk.blocks.11.norm2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,560 checkpoint.py: 885: Loaded: trunk.blocks.11.mlp.fc1.weight of shape: torch.Size([1536, 384]) from checkpoint INFO 2021-12-20 16:16:28,560 checkpoint.py: 885: Loaded: trunk.blocks.11.mlp.fc1.bias of shape: torch.Size([1536]) from checkpoint INFO 2021-12-20 16:16:28,561 checkpoint.py: 885: Loaded: trunk.blocks.11.mlp.fc2.weight of shape: torch.Size([384, 1536]) from checkpoint INFO 2021-12-20 16:16:28,561 checkpoint.py: 885: Loaded: trunk.blocks.11.mlp.fc2.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,561 checkpoint.py: 885: Loaded: trunk.norm.weight of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,562 checkpoint.py: 885: Loaded: trunk.norm.bias of shape: torch.Size([384]) from checkpoint INFO 2021-12-20 16:16:28,562 checkpoint.py: 901: Extra layers not loaded from checkpoint: ['heads.0.projection_head.0.weight', 'heads.0.projection_head.0.bias', 'heads.0.projection_head.2.weight', 'heads.0.projection_head.2.bias', 'heads.0.projection_head.4.weight', 'heads.0.projection_head.4.bias', 'heads.0.prototypes0.weight_g', 'heads.0.prototypes0.weight_v'] INFO 2021-12-20 16:16:28,618 trainer_main.py: 342: Model is: Classy <class 'vissl.models.base_ssl_model.BaseSSLMultiInputOutputModel'>: BaseSSLMultiInputOutputModel( (_heads): ModuleDict() (trunk): VisionTransformer( (patch_embed): PatchEmbed( (proj): Conv2d(3, 384, kernel_size=(16, 16), stride=(16, 16)) ) (pos_drop): Dropout(p=0, inplace=False) (blocks): ModuleList( (0): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): Identity() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (1): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (2): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (3): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (4): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (5): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (6): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (7): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (8): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (9): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (10): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) (11): Block( (norm1): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (attn): Attention( (qkv): Linear(in_features=384, out_features=1152, bias=True) (attn_drop): Dropout(p=0, inplace=False) (proj): Linear(in_features=384, out_features=384, bias=True) (proj_drop): Dropout(p=0, inplace=False) ) (drop_path): DropPath() (norm2): LayerNorm((384,), eps=1e-06, elementwise_affine=True) (mlp): Mlp( (fc1): Linear(in_features=384, out_features=1536, bias=True) (act): GELU() (fc2): Linear(in_features=1536, out_features=384, bias=True) (drop): Dropout(p=0, inplace=False) ) ) ) (norm): LayerNorm((384,), eps=1e-06, elementwise_affine=True) ) (heads): ModuleList() (dummy_layer): Linear(in_features=4, out_features=4, bias=True) ) INFO 2021-12-20 16:16:28,618 trainer_main.py: 352: ============== Split: TEST ======================= INFO 2021-12-20 16:16:28,618 trainer_main.py: 353: Extracting features for partition: test INFO 2021-12-20 16:16:31,114 trainer_main.py: 414: Model set to eval mode during feature extraction... Traceback (most recent call last): File "tools/run_distributed_engines.py", line 58, in
hydra_main(overrides=overrides)
File "tools/run_distributed_engines.py", line 41, in hydra_main
launch_distributed(
File "/hissl/third_party/vissl/vissl/utils/distributed_launcher.py", line 150, in launch_distributed
_distributed_worker(
File "/hissl/third_party/vissl/vissl/utils/distributed_launcher.py", line 192, in _distributed_worker
run_engine(
File "/hissl/third_party/vissl/vissl/engines/engine_registry.py", line 86, in run_engine
engine.run_engine(
File "/hissl/third_party/vissl/vissl/engines/extract_features.py", line 39, in run_engine
extract_main(
File "/hissl/third_party/vissl/vissl/engines/extract_features.py", line 106, in extract_main
trainer.extract(output_folder=cfg.EXTRACT_FEATURES.OUTPUT_DIR or checkpoint_folder)
File "/hissl/third_party/vissl/vissl/trainer/trainer_main.py", line 355, in extract
self._extract_split_features(feat_names, self.task, split, output_folder)
File "/hissl/third_party/vissl/vissl/trainer/trainer_main.py", line 435, in _extract_split_features
flat_features_list = self._flatten_features_list(features)
File "/hissl/third_party/vissl/vissl/trainer/trainer_main.py", line 363, in _flatten_features_list
assert isinstance(features, list), "features must be of type list"
AssertionError: features must be of type list
wget -nc -q https://github.com/facebookresearch/vissl/raw/main/vissl/utils/collect_env.py && python collect_env.py
if is_feature_extractor_model(self.model_config): self.eval_mode = True return FeatureExtractorModel(self.model_config) else: self.eval_mode = False trunk_name = self.model_config.TRUNK.NAME return get_model_trunk(trunk_name)(self.model_config, trunk_name)
return ( model_config.FEATURE_EVAL_SETTINGS.EVAL_MODE_ON and model_config.FEATURE_EVAL_SETTINGS.FREEZE_TRUNK_ONLY and len(model_config.FEATURE_EVAL_SETTINGS.LINEAR_EVAL_FEAT_POOL_OPS_MAP) > 0 )