detrium.utils.profiler

Optional FLOPs/MACs/parameter profiler (lazy dependency on `calflops`).

model_stats(model: nn.Module, input_shape: Tuple[int, int, int, int]=(1, 3, 640, 640)) -> Tuple[int, Dict[str, str]]

Compute parameter count and (when `calflops` is installed) FLOPs/MACs.

名称类型默认值
modelnn.Module—
input_shapeTuple[int, int, int, int](1, 3, 640, 640)