set defalut attr max=3.4028235e+38
@@ -16,6 +16,9 @@ import onnx
import numpy as np
from onnx import onnx_pb, helper
+MAX_FLOAT32 = np.asarray(
+ [255, 255, 127, 127], dtype=np.uint8).view(np.float32)[0]
+
def get_old_name(arg, name_prefix=''):
prefix_index = arg.find(name_prefix)
@@ -766,7 +769,7 @@ def yolo_box(op, block):
inputs=outputs_pred_box_x1_decode,
outputs=outputs_pred_box_x1_clip,
min=0.0,
- max=float(np.inf))
+ max=MAX_FLOAT32)
node_list.append(node_pred_box_x1_clip)
node_pred_box_y1_clip = onnx.helper.make_node(
@@ -774,7 +777,7 @@ def yolo_box(op, block):
inputs=outputs_pred_box_y1_decode,
outputs=outputs_pred_box_y1_clip,
min=0.0,
- max=float(np.inf))
+ max=MAX_FLOAT32)
node_list.append(node_pred_box_y1_clip)
node_pred_box_x2_clip = onnx.helper.make_node(
@@ -782,7 +785,7 @@ def yolo_box(op, block):
inputs=outputs_pred_box_x2_sub_w,
outputs=outputs_pred_box_x2_clip,
min=0.0,
- max=float(np.inf))
+ max=MAX_FLOAT32)
node_list.append(node_pred_box_x2_clip)
node_pred_box_y2_clip = onnx.helper.make_node(
@@ -790,7 +793,7 @@ def yolo_box(op, block):
inputs=outputs_pred_box_y2_sub_h,
outputs=outputs_pred_box_y2_clip,
min=0.0,
- max=float(np.inf))
+ max=MAX_FLOAT32)
node_list.append(node_pred_box_y2_clip)
outputs_pred_box_x2_res = [model_name + "@box_x2_res"]
