A solution: HRNet Backbone Adopt_different_blocks_bug(BASIC//BOTTLENECK)
https://github.com/HRNet/HRNet-Image-Classification/blob/8f158719e821836e21e6cba99a3241a12a13bc41/lib/models/cls_hrnet.py#L459~L473 If different block types are used in different stages, instead of the default bottleneck-basic-basic-basic in the original yaml file, the channel mismatch error as shown in the figure below will appear. To avoid this error, we change it in the transition layer and use conv3*3 between different stages to match the number of channels. The corrected code and results are shown in the figure below. (The demonstration is only a proof of feasibility, not an actual demonstration of the code)

`# ############################# Modified by Mingyang ##############################################################
##################### Adopt_different_blocks_bug(BASIC//BOTTLENECK)
# x_list = []
# for i in range(self.stage3_cfg['NUM_BRANCHES']):
# if self.transition2[i] is not None:
# x_list.append(self.transition2[i](y_list[-1]))
# else:
# x_list.append(y_list[i])
# y_list = self.stage3(x_list)
# x_list = []
# for i in range(self.stage4_cfg['NUM_BRANCHES']):
# if self.transition3[i] is not None:
# x_list.append(self.transition3[i](y_list[-1]))
# else:
# x_list.append(y_list[i])
# y_list = self.stage4(x_list)
x_list = []
for i in range(self.stage3_cfg['NUM_BRANCHES']): # 3
if self.transition2[i] is not None and i < self.stage2_cfg['NUM_BRANCHES']: # 有通道数匹配卷积且处于平连阶段
x_list.append(self.transition2[i](y_list[i])) # #################bug
elif self.transition2[i] is not None and i >= self.stage2_cfg['NUM_BRANCHES']: # 下采样阶段
x_list.append(self.transition2[i](y_list[-1])) # #################bug
else: # ############应改为
x_list.append(y_list[i])
y_list = self.stage3(x_list)
x_list = []
for i in range(self.stage4_cfg['NUM_BRANCHES']): # 4
if self.transition3[i] is not None and i < self.stage3_cfg['NUM_BRANCHES']: # 有通道数匹配卷积且处于平连阶段:
x_list.append(self.transition3[i](y_list[i])) # #################bug
elif self.transition3[i] is not None and i >= self.stage3_cfg['NUM_BRANCHES']: # 下采样阶段
x_list.append(self.transition3[i](y_list[-1])) # #################bug
else:
x_list.append(y_list[i])
y_list = self.stage4(x_list) # stage4中的multi_scale_output不是False,所以产生[fuse_x0,fuse_x1,fuse_x2,fuse_x3]