sgl-project/sglang · error · FileNotFoundError
RIFE weight file not found: {flownet_path} Expected layout:
Error message
RIFE weight file not found: {flownet_path}
Expected layout: <model_path>/flownet.pkl What it means
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.
Source
Thrown at python/sglang/multimodal_gen/runtime/postprocess/rife_interpolator.py:288
def eval(self) -> "Model":
self.flownet.eval()
return self
def device(self) -> torch.device:
return next(self.flownet.parameters()).device
def load_model(self, path: str, strip_module_prefix: bool = True) -> None:
"""Load weights from {path}/flownet.pkl.
Args:
path: Directory containing ``flownet.pkl``.
strip_module_prefix: If True, strip the ``module.`` prefix that
``DataParallel`` / ``DistributedDataParallel`` adds to keys.
"""
flownet_path = os.path.join(path, "flownet.pkl")
if not os.path.isfile(flownet_path):
raise FileNotFoundError(
f"RIFE weight file not found: {flownet_path}\n"
"Expected layout: <model_path>/flownet.pkl"
)
def convert(param):
if strip_module_prefix:
return {
k.replace("module.", ""): v
for k, v in param.items()
if "module." in k
}
else:
return {k: v for k, v in param.items() if "module." not in k}
state = torch.load(flownet_path, map_location="cpu", weights_only=False)
self.flownet.load_state_dict(convert(state), strict=False)
logger.info("Loaded RIFE weights from %s", flownet_path)
View on GitHub (pinned to 0132848349)
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
Example fix
# before
interp.load_model("/models/rife.zip")
# after
# /models/rife/flownet.pkl must exist
interp.load_model("/models/rife") Defensive patterns
Strategy: validation
Validate before calling
import os assert os.path.isfile(os.path.join(model_path, "flownet.pkl")), "missing flownet.pkl"
Type guard
def rife_model_dir_ok(p: str) -> bool:
import os; return os.path.isfile(os.path.join(p, "flownet.pkl")) Prevention
- Preserve the RIFE directory layout (dir containing flownet.pkl) when extracting
- Verify model artifacts exist in startup health checks
When it happens
Trigger: 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.
Common situations: Downloading RIFE weights as a raw file instead of preserving directory layout; partial extraction; pointing at the parent of the actual model dir.
Related errors
- Weight file {source.filename!r} was not found in {source.rep
- No model weights found in {path} (expected model.safetensors
- metal shader source not found: {metal_src}
- Prompt text file not found: {path}
- no safetensors files found in {quantized_path or component_m
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/a407ee2bd97c56b1.
Report an issue: GitHub.