未验证 提交 71fb62c2 编写于 作者: H Huihuang Zheng 提交者: GitHub

[Dy2stat] Fix windows dy2stat test_yolov3 random failure (#24908)

The random failure at Windows may due to some random gt_boxes can cause some numbers in YoloV3 to be negative thus access the invalid memory. This PR tries to solve it.
上级 8f416eb1
...@@ -53,13 +53,9 @@ class FakeDataReader(object): ...@@ -53,13 +53,9 @@ class FakeDataReader(object):
for j in range(cfg.batch_size): for j in range(cfg.batch_size):
img = np.random.normal(0.485, 0.229, img = np.random.normal(0.485, 0.229,
[3, cfg.input_size, cfg.input_size]) [3, cfg.input_size, cfg.input_size])
gt_boxes_node1 = np.random.randint( point1 = cfg.input_size / 4
low=cfg.input_size / 4, point2 = cfg.input_size / 2
high=cfg.input_size / 2, gt_boxes = np.array([[point1, point1, point2, point2]])
size=[1, 2])
gt_boxes_node2 = gt_boxes_node1 + cfg.input_size / 4
gt_boxes = np.concatenate(
(gt_boxes_node1, gt_boxes_node2), axis=1)
gt_labels = np.random.randint( gt_labels = np.random.randint(
low=0, high=cfg.class_num, size=[1]) low=0, high=cfg.class_num, size=[1])
gt_scores = np.zeros([1]) gt_scores = np.zeros([1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册