diff --git a/python/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/src/acl_net.py b/python/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/src/acl_net.py index a70a7f7ddda983796475b5421c216f5bc0e024d8..ef60270b61790ff5dff0e9e9b918fc88be26c60d 100644 --- a/python/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/src/acl_net.py +++ b/python/level2_simple_inference/1_classification/resnet50_async_imagenet_classification/src/acl_net.py @@ -51,7 +51,7 @@ class Net(object): self.model_id = None # pointer self.context = None # pointer self.stream = None # pointer - self.excute_times = execute_times + self.execute_times = execute_times self.callback_interval = callback_interval self.is_callback = True if callback_interval else False self.memory_pool = memory_pool @@ -169,8 +169,8 @@ class Net(object): for idx in range(self.memory_pool): img_idx = idx % len(images_dataset_list) img_input = self._load_input_data(images_dataset_list[img_idx]) - infer_ouput = self._load_output_data() - self.dataset_list.append([img_input, infer_ouput]) + infer_output = self._load_output_data() + self.dataset_list.append([img_input, infer_output]) print("data interaction from host to device success") def _destroy_dataset_and_databuf(self, ): @@ -226,16 +226,16 @@ class Net(object): def _get_callback(self, idx): if (idx + 1) % self.callback_interval == 0: acl.rt.launch_callback(self.callback_func, - self.excute_dataset, + self.execute_dataset, 1, self.stream) - self.dataset_list.extend(self.excute_dataset) - self.excute_dataset = [] + self.dataset_list.extend(self.execute_dataset) + self.execute_dataset = [] def forward(self): print('execute stage:') - self.excute_dataset = [] - for idx in range(self.excute_times): + self.execute_dataset = [] + for idx in range(self.execute_times): img_data, infer_output = self.dataset_list.pop(0) ret = acl.mdl.execute_async(self.model_id, img_data, @@ -244,7 +244,7 @@ class Net(object): check_ret("acl.mdl.execute_async", ret) if self.is_callback: - self.excute_dataset.append([img_data, infer_output]) + self.execute_dataset.append([img_data, infer_output]) self._get_callback(idx) print('execute stage success')