cgtuebingen / Flex-Convolution

Source code for: Flex-Convolution (Million-Scale Point-Cloud Learning Beyond Grid-Worlds), accepted at ACCV 2018
Apache License 2.0
115 stars 11 forks source link

wrong shape of knn_bruteforce output #8

Closed david-klindt closed 5 years ago

david-klindt commented 5 years ago

The tensor returned by knn_bruteforce should have shape B x K x N but the K is always 0 when I am checking the output shape on a static tensor. Inside a session when I evaluate the function, the output has the correct shape.

PatWie commented 5 years ago

That has been a result of renaming "K" to "k".

➜ ~/git/github.com/cgtuebingen/Flex-Convolution/user_ops :master✗ python
Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __init__ import knn_bruteforce
>>> import tensorflow as tf
>>> p = tf.placeholder(tf.float32, [8, 3, 1024])
>>> outs = knn_bruteforce(p, k=3)
>>> outs
KnnBruteforce(neighborhood_out=<tf.Tensor 'KnnBruteforce:0' shape=(8, 1024, 3) dtype=int32>, distances=<tf.Tensor 'KnnBruteforce:1' shape=(8, 1024, 3) dtype=float32>)
>>> 

Please note the output should be [B, N, K] (ordering of K and N)

david-klindt commented 5 years ago

Hmm I cannot reproduce your code:

root@630f428645eb:/gpfs01/bethge/home/dklindt/Flex-Convolution# python3 Python 3.6.3 (default, Oct 6 2017, 08:44:35) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information.

from layers import knn_bruteforce import tensorflow as tf p = tf.placeholder(tf.float32, [8, 3, 1024]) outs = knn_bruteforce(p, k=3) outs <tf.Tensor 'knn_bruteforce/transpose:0' shape=(8, 0, 1024) dtype=int32>

PatWie commented 5 years ago

You did notice the commit 570e1b6 in between of our conversation?

david-klindt commented 5 years ago

ah sorry I didn't see that, works now, thanks again! :)