Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Union function" returns wrong outputs when it is used with "MinkowskiGenerativeConvolutionTranspose" #279

Closed
chrockey opened this issue Dec 17, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@chrockey
Copy link
Contributor

chrockey commented Dec 17, 2020

Hi,

I found that MinkowskiUnion returns a little bit wrong output when it merges coordinate_map_key generated by MinkowskiGenerativeConvolutionTranspose.

Here is my test code.

  5 def test_kernel_map():                                                                                                                                                                                                                                                                
  6     ME.set_sparse_tensor_operation_mode(ME.SparseTensorOperationMode.SHARE_COORDINATE_MANAGER)                                                                                                                                                                                        
  7     device = torch.device('cuda')                                                                                                                                                                                                                                                     
  8                                                                                                                                                                                                                                                                                       
  9     A = ME.SparseTensor(                                                                                                                                                                                                                                                              
 10             features=torch.FloatTensor([[1]]),                                                                                                                                                                                                                                        
 11             coordinates=torch.IntTensor([[0, 0, 0, 0]]),                                                                                                                                                                                                                              
 12             tensor_stride=2,                                                                                                                                                                                                                                                          
 13             device=device                                                                                                                                                                                                                                                             
 14         )                                                                                                                                                                                                                                                                             
 15     B = ME.SparseTensor(                                                                                                                                                                                                                                                              
 16             features=torch.FloatTensor([[2], [2]]),                                                                                                                                                                                                                                   
 17             coordinates=torch.IntTensor([[0, 1, 1, 1], [0, 100, 0, 0]]),                                                                                                                                                                                                              
 18             device=device                                                                                                                                                                                                                                                             
 19         )                                                                                                                                                                                                                                                                             
 20     gconvtr = ME.MinkowskiGenerativeConvolutionTranspose(in_channels=1,                                                                                                                                                                                                               
 21                                                          out_channels=1,                                                                                                                                                                                                              
 22                                                          kernel_size=3,                                                                                                                                                                                                               
 23                                                          stride=2,                                                                                                                                                                                                                    
 24                                                          dimension=3).to(device)                                                                                                                                                                                                      
 25     union = ME.MinkowskiUnion()                                                                                                                                                                                                                                                       
 26     cm = A.coordinate_manager                                                                                                                                                                                                                                                         
 27     A_tr = gconvtr(A)                                                                                                                                                                                                                                                                 
 28     A_tr = union(A_tr, B)                                                                                                                                                                                                                                                              
 29     print(A_tr.C)

[0, 100, 0, 0] is not included in the output coordinate.
However the size of output coordinate map is 28, which is correct.
The reason why the size is correct although [0, 100, 0, 0] is not included is that there is a duplicated coordinate [0, 0, -1 ,-1].
I searched for why this happened but failed :( ...

@chrischoy chrischoy added the bug Something isn't working label Dec 23, 2020
chrischoy added a commit that referenced this issue Dec 25, 2020
Tanazzah pushed a commit to Tanazzah/MinkowskiEngine that referenced this issue Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants