Start export implementation (#110)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2022-12-29 14:17:14 +01:00 committed by GitHub
parent c1b38428bc
commit 92dad1c1b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 827 additions and 222 deletions

View file

@ -135,8 +135,8 @@ def model_info(model, verbose=False, imgsz=640):
flops = get_flops(model, imgsz)
fs = f', {flops:.1f} GFLOPs' if flops else ''
name = Path(model.yaml_file).stem.replace('yolov5', 'YOLOv5') if hasattr(model, 'yaml_file') else 'Model'
LOGGER.info(f"{name} summary: {len(list(model.modules()))} layers, {n_p} parameters, {n_g} gradients{fs}")
m = Path(getattr(model, 'yaml_file', '') or model.yaml.get('yaml_file', '')).stem.replace('yolo', 'YOLO') or 'Model'
LOGGER.info(f"{m} summary: {len(list(model.modules()))} layers, {n_p} parameters, {n_g} gradients{fs}")
def get_num_params(model):