charlesq34 / pointnet2

PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space
Other
3.17k stars 902 forks source link

Cannot feed value of shape (16, 1024, 6) for Tensor 'Placeholder:0', which has shape '(16, 1024, 3)' (Python 3 Attempt) #232

Closed EXJUSTICE closed 2 years ago

EXJUSTICE commented 2 years ago

After much debugging I've managed to get the repo to start training in Colab, using TF 1.13 and Python 3. Using the modelnet40 resampled dataset (1.6 GB) from the documentation.

However, the train.py method gives me the error

Traceback (most recent call last):
  File "train.py", line 285, in <module>
    train()
  File "train.py", line 178, in train
    train_one_epoch(sess, ops, train_writer)
  File "train.py", line 212, in train_one_epoch
    ops['train_op'], ops['loss'], ops['pred']], feed_dict=feed_dict)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py", line 929, in run
    run_metadata_ptr)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py", line 1128, in _run
    str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (16, 1024, 6) for Tensor 'Placeholder:0', which has shape '(16, 1024, 3)'

I believe it may be due to the need to change all of the xrange() methods in provider.py to range(), but I'm not sure how to approach this?

EXJUSTICE commented 2 years ago

The problem was due to using the resampled dataset, which converts the data format into a 6 channel data. The model is configured out of the box for 3 channeled data, hence the problem occurs. Switching to the hdf5 data solves this problem, this was not clear however.