| @@ -137,7 +137,7 @@ def ssd_bboxes_encode(boxes): | |||||
| num_match_num = np.array([len(np.nonzero(t_label)[0])], dtype=np.int32) | num_match_num = np.array([len(np.nonzero(t_label)[0])], dtype=np.int32) | ||||
| return bboxes, t_label.astype(np.int32), num_match_num | return bboxes, t_label.astype(np.int32), num_match_num | ||||
| def ssd_bboxes_decode(boxes, index, image_shape): | |||||
| def ssd_bboxes_decode(boxes, index): | |||||
| """Decode predict boxes to [x, y, w, h]""" | """Decode predict boxes to [x, y, w, h]""" | ||||
| boxes_t = boxes[index] | boxes_t = boxes[index] | ||||
| default_boxes_t = default_boxes[index] | default_boxes_t = default_boxes[index] | ||||
| @@ -51,9 +51,9 @@ def get_lr(learning_rate, start_step, global_step, decay_step, decay_rate, steps | |||||
| return lr_each_step | return lr_each_step | ||||
| def init_net_param(net, init_value='ones'): | |||||
| """Init:wq the parameters in net.""" | |||||
| params = net.trainable_params() | |||||
| def init_net_param(network, init_value='ones'): | |||||
| """Init:wq the parameters in network.""" | |||||
| params = network.trainable_params() | |||||
| for p in params: | for p in params: | ||||
| if isinstance(p.data, Tensor) and 'beta' not in p.name and 'gamma' not in p.name and 'bias' not in p.name: | if isinstance(p.data, Tensor) and 'beta' not in p.name and 'gamma' not in p.name and 'bias' not in p.name: | ||||
| p.set_parameter_data(initializer(init_value, p.data.shape(), p.data.dtype())) | p.set_parameter_data(initializer(init_value, p.data.shape(), p.data.dtype())) | ||||
| @@ -31,7 +31,7 @@ def AKGAddPath(): | |||||
| class AKGMetaPathFinder: | class AKGMetaPathFinder: | ||||
| """class AKGMetaPath finder.""" | """class AKGMetaPath finder.""" | ||||
| def find_module(self, fullname, path=None): | |||||
| def find_module(self, fullname): | |||||
| """method _akg find module.""" | """method _akg find module.""" | ||||
| if fullname.startswith("_akg.tvm"): | if fullname.startswith("_akg.tvm"): | ||||
| rname = fullname[5:] | rname = fullname[5:] | ||||