From d257c75c848ccab4d9195300a61195cf0dfef1bf Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 5 Apr 2022 21:21:57 +0200 Subject: [PATCH] Update export.py (#7301) * Update export.py Simplify code. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- export.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/export.py b/export.py index df4f3b6e0..16ba2ffce 100644 --- a/export.py +++ b/export.py @@ -480,15 +480,10 @@ def run( im, model = im.half(), model.half() # to FP16 model.train() if train else model.eval() # training mode = no Detect() layer grid construction for k, m in model.named_modules(): - # if isinstance(m, Conv): # assign export-friendly activations - # if isinstance(m.act, nn.SiLU): - # m.act = SiLU() if isinstance(m, Detect): m.inplace = inplace m.onnx_dynamic = dynamic m.export = True - if hasattr(m, 'forward_export'): - m.forward = m.forward_export # assign custom forward (optional) for _ in range(2): y = model(im) # dry runs