{"record":{"id":"1ea5b83e37dbadec","repo":"huggingface/pytorch-image-models","slug":"unknown-rope-type-cfg-rope-type","errorCode":null,"errorMessage":"Unknown rope_type: {cfg.rope_type}","messagePattern":"Unknown rope_type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"timm/models/naflexvit.py","lineNumber":1280,"sourceCode":"                    temperature=cfg.rope_temperature,\n                    feat_shape=None,  # Dynamic shapes for NaFlex\n                    grid_indexing=cfg.rope_grid_indexing,\n                    rotate_half=cfg.rope_rotate_half,\n                    **dd,\n                )\n                self.rope_is_mixed = False\n            elif cfg.rope_type == 'mrope':\n                assert cfg.rope_mrope_section is not None, \"rope_type='mrope' requires cfg.rope_mrope_section\"\n                self.rope = RotaryEmbeddingMRope(\n                    cfg.embed_dim // cfg.num_heads,\n                    mrope_section=cfg.rope_mrope_section,\n                    temperature=cfg.rope_temperature,\n                    grid_indexing=cfg.rope_grid_indexing,\n                    **dd,\n                )\n                self.rope_is_mixed = False\n            else:\n                raise ValueError(f\"Unknown rope_type: {cfg.rope_type}\")\n\n        # Patch dropout\n        if cfg.patch_drop_rate > 0:\n            self.patch_drop = PatchDropoutWithIndices(\n                cfg.patch_drop_rate,\n                num_prefix_tokens=self.num_prefix_tokens,\n            )\n        else:\n            self.patch_drop = None\n\n        # Transformer blocks\n        dpr = calculate_drop_path_rates(cfg.drop_path_rate, cfg.depth)  # stochastic depth decay rule\n        # Create transformer blocks\n        self.blocks = nn.Sequential(*[\n            block_fn(\n                dim=cfg.embed_dim,\n                num_heads=cfg.num_heads,\n                mlp_ratio=cfg.mlp_ratio,","sourceCodeStart":1262,"sourceCodeEnd":1298,"githubUrl":"https://github.com/huggingface/pytorch-image-models/blob/9a5261e31b3b5128526eb2658333b4c0a54464ae/timm/models/naflexvit.py#L1262-L1298","documentation":"The block decoder in naflexvit only supports a fixed set of rope_type values (e.g. None/'none' and the rope paths above the else branch). Any other cfg.rope_type string hits the catch-all ValueError.","triggerScenarios":"Building NaFlexViT blocks with cfg.rope_type set to an unsupported value such as 'axial', 'partial', or a typo like 'npe' instead of 'rope'/'none'.","commonSituations":"Porting RoPE config keys from other ViT implementations (HF llama-style rope_type names) into timm NaFlex configs.","solutions":["Use one of the supported rope_type values in the block cfg (check the if/elif chain above line 1280 for accepted names)","Set rope_type=None/'none' to disable RoPE"],"exampleFix":"# before\ncfg = replace(cfg, rope_type='axial')\n# after\ncfg = replace(cfg, rope_type='rope')","handlingStrategy":"validation","validationCode":"VALID_ROPE = {None, 'none', 'rope'}  # match branch names at naflexvit.py:1280\nassert cfg.rope_type in VALID_ROPE","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a module-level frozenset of supported rope_type values synced with the decoder","Don't copy rope_type strings from other libraries"],"tags":["timm","naflexvit","rope","config"],"backgroundTag":"invalid-argument-value","analyzedSha":"9a5261e31b3b5128526eb2658333b4c0a54464ae","analyzedAt":"2026-08-27T02:34:25.417Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}