diff --git a/paddleslim/nas/search_space/mobilenetv2.py b/paddleslim/nas/search_space/mobilenetv2.py index 37099ae6dcfa0ae4a362f249c04e271404fccd34..5b8aa4feab1e5fbd5397272d4c6899f33e600ffd 100644 --- a/paddleslim/nas/search_space/mobilenetv2.py +++ b/paddleslim/nas/search_space/mobilenetv2.py @@ -60,7 +60,6 @@ class MobileNetV2Space(SearchSpaceBase): # original MobileNetV2 # yapf: disable init_token_base = [4, # 1, 16, 1 - 4, 5, 1, 0, # 6, 24, 1 4, 5, 1, 0, # 6, 24, 2 4, 4, 2, 0, # 6, 32, 3 4, 4, 3, 0, # 6, 64, 4 @@ -75,10 +74,9 @@ class MobileNetV2Space(SearchSpaceBase): """ Get range table of current search space, constrains the range of tokens. """ - # head_num + 7 * [multiple(expansion_factor), filter_num, repeat, kernel_size] + # head_num + 6 * [multiple(expansion_factor), filter_num, repeat, kernel_size] # yapf: disable range_table_base = [len(self.head_num), - len(self.multiply), len(self.filter_num1), len(self.repeat), len(self.k_size), len(self.multiply), len(self.filter_num1), len(self.repeat), len(self.k_size), len(self.multiply), len(self.filter_num2), len(self.repeat), len(self.k_size), len(self.multiply), len(self.filter_num3), len(self.repeat), len(self.k_size), @@ -103,23 +101,20 @@ class MobileNetV2Space(SearchSpaceBase): (self.multiply[tokens[1]], self.filter_num1[tokens[2]], self.repeat[tokens[3]], 2, self.k_size[tokens[4]])) self.bottleneck_params_list.append( - (self.multiply[tokens[5]], self.filter_num1[tokens[6]], + (self.multiply[tokens[5]], self.filter_num2[tokens[6]], self.repeat[tokens[7]], 2, self.k_size[tokens[8]])) self.bottleneck_params_list.append( - (self.multiply[tokens[9]], self.filter_num2[tokens[10]], + (self.multiply[tokens[9]], self.filter_num3[tokens[10]], self.repeat[tokens[11]], 2, self.k_size[tokens[12]])) self.bottleneck_params_list.append( - (self.multiply[tokens[13]], self.filter_num3[tokens[14]], - self.repeat[tokens[15]], 2, self.k_size[tokens[16]])) - self.bottleneck_params_list.append( - (self.multiply[tokens[17]], self.filter_num4[tokens[18]], - self.repeat[tokens[19]], 1, self.k_size[tokens[20]])) + (self.multiply[tokens[13]], self.filter_num4[tokens[14]], + self.repeat[tokens[15]], 1, self.k_size[tokens[16]])) self.bottleneck_params_list.append( - (self.multiply[tokens[21]], self.filter_num5[tokens[22]], - self.repeat[tokens[23]], 2, self.k_size[tokens[24]])) + (self.multiply[tokens[17]], self.filter_num5[tokens[18]], + self.repeat[tokens[19]], 2, self.k_size[tokens[20]])) self.bottleneck_params_list.append( - (self.multiply[tokens[25]], self.filter_num6[tokens[26]], - self.repeat[tokens[27]], 1, self.k_size[tokens[28]])) + (self.multiply[tokens[21]], self.filter_num6[tokens[22]], + self.repeat[tokens[23]], 1, self.k_size[tokens[24]])) def _modify_bottle_params(output_stride=None): if output_stride is not None and output_stride % 2 != 0: