ultralytics 8.2.27 replace onnxsim with onnxslim (#12989)

Co-authored-by: inisis <desmond.yao@buaa.edu.cn>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: inisis <46103969+inisis@users.noreply.github.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Kayzwer 2024-06-01 01:03:34 +08:00 committed by GitHub
parent dd13707bf8
commit 8fb140688a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 27 additions and 20 deletions

View file

@ -457,6 +457,8 @@ class ProfileModels:
input_tensor = sess.get_inputs()[0]
input_type = input_tensor.type
dynamic = not all(isinstance(dim, int) and dim >= 0 for dim in input_tensor.shape) # dynamic input shape
input_shape = (1, 3, self.imgsz, self.imgsz) if dynamic else input_tensor.shape
# Mapping ONNX datatype to numpy datatype
if "float16" in input_type:
@ -472,7 +474,7 @@ class ProfileModels:
else:
raise ValueError(f"Unsupported ONNX datatype {input_type}")
input_data = np.random.rand(*input_tensor.shape).astype(input_dtype)
input_data = np.random.rand(*input_shape).astype(input_dtype)
input_name = input_tensor.name
output_name = sess.get_outputs()[0].name