{"record":{"id":"a407ee2bd97c56b1","repo":"sgl-project/sglang","slug":"rife-weight-file-not-found-flownet-path-expecte","errorCode":null,"errorMessage":"RIFE weight file not found: {flownet_path}\nExpected layout: <model_path>/flownet.pkl","messagePattern":"RIFE weight file not found: (.+?)\nExpected layout: <model_path>/flownet\\.pkl","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/postprocess/rife_interpolator.py","lineNumber":288,"sourceCode":"\n    def eval(self) -> \"Model\":\n        self.flownet.eval()\n        return self\n\n    def device(self) -> torch.device:\n        return next(self.flownet.parameters()).device\n\n    def load_model(self, path: str, strip_module_prefix: bool = True) -> None:\n        \"\"\"Load weights from {path}/flownet.pkl.\n\n        Args:\n            path: Directory containing ``flownet.pkl``.\n            strip_module_prefix: If True, strip the ``module.`` prefix that\n                ``DataParallel`` / ``DistributedDataParallel`` adds to keys.\n        \"\"\"\n        flownet_path = os.path.join(path, \"flownet.pkl\")\n        if not os.path.isfile(flownet_path):\n            raise FileNotFoundError(\n                f\"RIFE weight file not found: {flownet_path}\\n\"\n                \"Expected layout: <model_path>/flownet.pkl\"\n            )\n\n        def convert(param):\n            if strip_module_prefix:\n                return {\n                    k.replace(\"module.\", \"\"): v\n                    for k, v in param.items()\n                    if \"module.\" in k\n                }\n            else:\n                return {k: v for k, v in param.items() if \"module.\" not in k}\n\n        state = torch.load(flownet_path, map_location=\"cpu\", weights_only=False)\n        self.flownet.load_state_dict(convert(state), strict=False)\n        logger.info(\"Loaded RIFE weights from %s\", flownet_path)\n","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/postprocess/rife_interpolator.py#L270-L306","documentation":"FileNotFoundError raised by RIFE interpolator load_model when the expected flownet.pkl is not present inside the given model directory. RIFE ships weights as <dir>/flownet.pkl and the loader refuses anything else.","triggerScenarios":"Calling load_model (directly or via _ensure_model_loaded before interpolation) with a path that is a zip/gguf, a directory with a differently-named pkl (e.g. 'flownet_v4.pkl'), or an empty/incomplete extraction.","commonSituations":"Downloading RIFE weights as a raw file instead of preserving directory layout; partial extraction; pointing at the parent of the actual model dir.","solutions":["Ensure the path is a directory containing flownet.pkl exactly","Rename your pkl to flownet.pkl if it's the correct RIFE weights","Re-download/extract the full RIFE model directory"],"exampleFix":"# before\ninterp.load_model(\"/models/rife.zip\")\n# after\n# /models/rife/flownet.pkl must exist\ninterp.load_model(\"/models/rife\")","handlingStrategy":"validation","validationCode":"import os\nassert os.path.isfile(os.path.join(model_path, \"flownet.pkl\")), \"missing flownet.pkl\"","typeGuard":"def rife_model_dir_ok(p: str) -> bool:\n    import os; return os.path.isfile(os.path.join(p, \"flownet.pkl\"))","tryCatchPattern":null,"preventionTips":["Preserve the RIFE directory layout (dir containing flownet.pkl) when extracting","Verify model artifacts exist in startup health checks"],"tags":["rife","weights","file-not-found","postprocess"],"backgroundTag":"model-weights-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}