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

Confusion with pointnet_cls.py #17

Closed
phoenixSP opened this issue Jun 23, 2017 · 3 comments
Closed

Confusion with pointnet_cls.py #17

phoenixSP opened this issue Jun 23, 2017 · 3 comments

Comments

@phoenixSP
Copy link

In pointnet_cls.py why have you expanded the dimension of the transformed input point cloud?

` def get_model(point_cloud, is_training, bn_decay=None):
""" Classification PointNet, input is BxNx3, output Bx40 """
batch_size = point_cloud.get_shape()[0].value
num_point = point_cloud.get_shape()[1].value
end_points = {}

with tf.variable_scope('transform_net1') as sc:
    transform = input_transform_net(point_cloud, is_training, bn_decay, K=3)
point_cloud_transformed = tf.matmul(point_cloud, transform)
input_image = tf.expand_dims(point_cloud_transformed, -1)

net = tf_util.conv2d(input_image, 64, [1,3],
                     padding='VALID', stride=[1,1],
                     bn=True, is_training=is_training,
                     scope='conv1', bn_decay=bn_decay)`
@EndingCredits
Copy link

It's because conv2d is used, so we need to add an extra 'dummy' dimension, as we only want to stride across one dimension.

An alternative could be to use conv1d but this does the same thing anyway (uses conv2d) and would mean tf would shape back and forth pointlessly in between convolutions.

@phoenixSP
Copy link
Author

I was looking through the code of tf_util.conv2d, basically the input_image should be 4D tensor.

@charlesq34
Copy link
Owner

Hi phoenixSP,

it's just a choice of implementation. You can also use conv1d (input will be 3D) or just batch matrix multiplication (input will be 2D) with a few more transformations.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants