Hi,
Thanks for your reply!
Sorry I don’t know I have to copy biases too… 
I’ve completed this part,
and here’s the code of copying biases in my case:
#copy bias from keras to pytorch
pt_model.conv1[0].bias.data = torch.from_numpy(np.transpose(weights[1]))
pt_model.conv1[2].bias.data = torch.from_numpy(np.transpose(weights[3]))

pt_model.conv2[0].bias.data = torch.from_numpy(np.transpose(weights[5]))
pt_model.conv2[2].bias.data = torch.from_numpy(np.transpose(weights[7]))

pt_model.conv3[0].bias.data = torch.from_numpy(np.transpose(weights[9]))
pt_model.conv3[2].bias.data = torch.from_numpy(np.transpose(weights[11]))

pt_model.conv4[0].bias.data = torch.from_numpy(np.transpose(weights[13]))
pt_model.conv4[2].bias.data = torch.from_numpy(np.transpose(weights[15]))

pt_model.conv5[0].bias.data = torch.from_numpy(np.transpose(weights[17]))
pt_model.conv5[2].bias.data = torch.from_numpy(np.transpose(weights[19]))

pt_model.up6.bias.data = torch.from_numpy(np.transpose(weights[21]))
pt_model.conv6[0].bias.data = torch.from_numpy(np.transpose(weights[23]))
pt_model.conv6[2].bias.data = torch.from_numpy(np.transpose(weights[25]))

pt_model.up7.bias.data = torch.from_numpy(np.transpose(weights[27]))
pt_model.conv7[0].bias.data = torch.from_numpy(np.transpose(weights[29]))
pt_model.conv7[2].bias.data = torch.from_numpy(np.transpose(weights[31]))

pt_model.up8.bias.data = torch.from_numpy(np.transpose(weights[33]))
pt_model.conv8[0].bias.data = torch.from_numpy(np.transpose(weights[35]))
pt_model.conv8[2].bias.data = torch.from_numpy(np.transpose(weights[37]))

pt_model.up9.bias.data = torch.from_numpy(np.transpose(weights[39]))
pt_model.conv9[0].bias.data = torch.from_numpy(np.transpose(weights[41]))
pt_model.conv9[2].bias.data = torch.from_numpy(np.transpose(weights[43]))

pt_model.conv10.bias.data = torch.from_numpy(weights[45])

The result seems more alike to the keras one
(Although there’s still a bit difference between them,
but it’s way better than the one I’ve done before)
By the way,
Do you have any idea whether there’s any redundant part in my C++ inference code?
I’m not sure if this is the most optimized code to run the inference process,
but I don’t know where can I revise for that…