jxqhhh / PytorchPointCNN

Apache License 2.0
10 stars 1 forks source link

question about X-matrix #2

Closed LiDaiY closed 4 years ago

LiDaiY commented 4 years ago

Thank you for your code. I notice that you implemented the X-matrix in the following way: ######################## X-transformation ######################### nn_pts_local = nn_pts_local.transpose(1, 3).transpose(2, 3) # (N,3,P,K) X_0 = self._modules["x_trans_conv1"].forward(nn_pts_local) X_0_KK = X_0.view(N, self.K, self.K, self.P).transpose(1, 2).transpose(2, 3)# (N,K,P,K) ############################################################# and you transpose the 1 and 2 dim of X_0 firstly instead of directly get the X_0_KK like that: X_0_KK = X_0.view(N, self.K, self.K, self.P).transpose(2, 3)# (N,K,P,K) I think it's very difference between the above two methods , but I didn't figure out why it was different.

In addition, I calculate parameters of shapenet_x8_2048_fps, the number is around 7.5 million, it seems very large....

Thank you for your code again, it's really close to the tensorflow version.

jxqhhh commented 4 years ago

Thank you for your code. I notice that you implemented the X-matrix in the following way: ######################## X-transformation ######################### nn_pts_local = nn_pts_local.transpose(1, 3).transpose(2, 3) # (N,3,P,K) X_0 = self._modules["x_trans_conv1"].forward(nn_pts_local) X_0_KK = X_0.view(N, self.K, self.K, self.P).transpose(1, 2).transpose(2, 3)# (N,K,P,K) ############################################################# and you transpose the 1 and 2 dim of X_0 firstly instead of directly get the X_0_KK like that: X_0_KK = X_0.view(N, self.K, self.K, self.P).transpose(2, 3)# (N,K,P,K) I think it's very difference between the above two methods , but I didn't figure out why it was different.

In addition, I calculate parameters of shapenet_x8_2048_fps, the number is around 7.5 million, it seems very large....

Thank you for your code again, it's really close to the tensorflow version.

Hi LiDaiY! First of all, the two ways of generating X_0_KK should both work well to my knowledge. The reason that I transpose the 1 and 2 dim of X_0 firstly is that I think it's closer to the official PointCNN implementation. As for the second question, I think it may be due to my wrong way of implementing depthwise convolution(which is named "depthConv" in my code). I would sincerely appreciate if if you'd like to correct the error here and make a pull request. Sorry that I have too much homework at school to correct the bug myself.

jxqhhh commented 4 years ago

Thank you for your code. I notice that you implemented the X-matrix in the following way: ######################## X-transformation ######################### nn_pts_local = nn_pts_local.transpose(1, 3).transpose(2, 3) # (N,3,P,K) X_0 = self._modules["x_trans_conv1"].forward(nn_pts_local) X_0_KK = X_0.view(N, self.K, self.K, self.P).transpose(1, 2).transpose(2, 3)# (N,K,P,K) ############################################################# and you transpose the 1 and 2 dim of X_0 firstly instead of directly get the X_0_KK like that: X_0_KK = X_0.view(N, self.K, self.K, self.P).transpose(2, 3)# (N,K,P,K) I think it's very difference between the above two methods , but I didn't figure out why it was different.

In addition, I calculate parameters of shapenet_x8_2048_fps, the number is around 7.5 million, it seems very large....

Thank you for your code again, it's really close to the tensorflow version.

Actually I also implemented my own tensorflow version of PointCNN. I remembered that after I corrected the bug in "depthConv" implementation in my tensorflow version, the performance of my code improved much.

LiDaiY commented 4 years ago

Thank you for your code. I notice that you implemented the X-matrix in the following way: ######################## X-transformation ######################### nn_pts_local = nn_pts_local.transpose(1, 3).transpose(2, 3) # (N,3,P,K) X_0 = self._modules["x_trans_conv1"].forward(nn_pts_local) X_0_KK = X_0.view(N, self.K, self.K, self.P).transpose(1, 2).transpose(2, 3)# (N,K,P,K) ############################################################# and you transpose the 1 and 2 dim of X_0 firstly instead of directly get the X_0_KK like that: X_0_KK = X_0.view(N, self.K, self.K, self.P).transpose(2, 3)# (N,K,P,K) I think it's very difference between the above two methods , but I didn't figure out why it was different. In addition, I calculate parameters of shapenet_x8_2048_fps, the number is around 7.5 million, it seems very large.... Thank you for your code again, it's really close to the tensorflow version.

Hi LiDaiY! First of all, the two ways of generating X_0_KK should both work well to my knowledge. The reason that I transpose the 1 and 2 dim of X_0 firstly is that I think it's closer to the official PointCNN implementation. As for the second question, I think it may be due to my wrong way of implementing depthwise convolution(which is named "depthConv" in my code). I would sincerely appreciate if if you'd like to correct the error here and make a pull request. Sorry that I have too much homework at school to correct the bug myself.

Thank you for your detailed reply. If I reproduce the results of the paper, I will try to improve this repo. But it may take a long time, because I've changed some parts of the code which made the seg model becoming hard to train, I'm still struggling with this problem.