You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
result = get_sliced_prediction(
img_path,
model,
slice_height=args.slice_height,
slice_width=args.slice_width,
overlap_height_ratio=args.overlap_height_ratio,
overlap_width_ratio=args.overlap_width_ratio,
)
running error:
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: images for the following indices
index: 2 Got: 1408 Expected: 800
index: 3 Got: 800 Expected: 1408
Please fix either the inputs/outputs or the model.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
1.pt2onnx
model = YOLO('best.pt')
success = model.export(format="onnx", dynamic=False, imgsz=(800,1408), opset=12)
2.detect
def load_detection_model():
return AutoDetectionModel.from_pretrained(
model_type='yolov8onnx',
model_path=args.model_path,
confidence_threshold=args.confidence_threshold,
category_mapping=category_mapping,
device=args.device
)
...
result = get_sliced_prediction(
img_path,
model,
slice_height=args.slice_height,
slice_width=args.slice_width,
overlap_height_ratio=args.overlap_height_ratio,
overlap_width_ratio=args.overlap_width_ratio,
)
running error:
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: images for the following indices
index: 2 Got: 1408 Expected: 800
index: 3 Got: 800 Expected: 1408
Please fix either the inputs/outputs or the model.
Beta Was this translation helpful? Give feedback.
All reactions