Skip to content

Commit

Permalink
fix vitual_input generate part
Browse files Browse the repository at this point in the history
  • Loading branch information
zen-xingle committed May 11, 2021
1 parent 2938b21 commit 45b1df0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions models/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
gs = int(max(model.stride)) # grid size (max stride)
opt.img_size = [check_img_size(x, gs) for x in opt.img_size] # verify img_size are gs-multiples

# Input
img = torch.zeros(opt.batch_size, 3, *opt.img_size).to(device) # image size(1,3,320,192) iDetection


# Update model
if opt.rknn_mode != True:
for k, m in model.named_modules():
Expand Down Expand Up @@ -133,6 +129,9 @@
if opt.add_image_preprocess_layer is True:
from models.common_rk_plug_in import preprocess_conv_layer
model = preprocess_conv_layer(model, 0, 255, True)
img = torch.zeros(opt.batch_size, *opt.img_size, 3).to(device)
else:
img = torch.zeros(opt.batch_size, 3, *opt.img_size).to(device)

y = model(img) # dry run
# ONNX export
Expand Down

0 comments on commit 45b1df0

Please sign in to comment.