pointnet.pytorch icon indicating copy to clipboard operation
pointnet.pytorch copied to clipboard

where can I get .ply data of ModelNet40?

Open simon3dv opened this issue 5 years ago • 4 comments

Hi, When I run pointnet.pytorch/utils$ python train_classification.py --dataset ../ModelNet40 --dataset_type modelnet40 I get error

  File "train_classification.py", line 102, in <module>
    for i, data in enumerate(dataloader, 0):
  File "/home/aming/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 819, in __next__
    return self._process_data(data)
  File "/home/aming/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
    data.reraise()
  File "/home/aming/anaconda3/lib/python3.7/site-packages/torch/_utils.py", line 385, in reraise
    raise self.exc_type(msg)
plyfile.PlyHeaderParseError: Caught PlyHeaderParseError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/aming/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/aming/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/aming/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/aming/文档/cls/pointnet.pytorch/pointnet/dataset.py", line 170, in __getitem__
    plydata = PlyData.read(f)
  File "/home/aming/anaconda3/lib/python3.7/site-packages/plyfile.py", line 392, in read
    data = PlyData._parse_header(stream)
  File "/home/aming/anaconda3/lib/python3.7/site-packages/plyfile.py", line 373, in _parse_header
    while parser.consume(stream.readline()):
  File "/home/aming/anaconda3/lib/python3.7/site-packages/plyfile.py", line 128, in consume
    ", ".join(self._allowed))
  File "/home/aming/anaconda3/lib/python3.7/site-packages/plyfile.py", line 134, in _error
    raise PlyHeaderParseError(message, self.lines)
plyfile.PlyHeaderParseError: line 1: expected one of {ply}

I think it's because my ModelNet40 only has .off data like ModelNet40/airplane/train/airplane_0001.off, which I download on http://modelnet.cs.princeton.edu/

Why there's no code to read from .off ? How can I convert .off to .ply?

simon3dv avatar Oct 27 '19 12:10 simon3dv

Hi, have you got it?

QiWang-SJTU avatar Dec 01 '19 03:12 QiWang-SJTU

@QiWang-SJTU No. I still wonder why they use *.ply to load modelnet40. I finally used modelnet40_ply_hdf5_2048.zip on https://shapenet.cs.stanford.edu/media/modelnet40_ply_hdf5_2048.zip which I found on https://github.com/charlesq34/pointnet/blob/master/provider.py, and rewrote this: https://github.com/fxia22/pointnet.pytorch/blob/f0c2430b0b1529e3f76fb5d6cd6ca14be763d975/pointnet/dataset.py#L167

simon3dv avatar Dec 01 '19 04:12 simon3dv

@QiWang-SJTU No. I still wonder why they use *.ply to load modelnet40. I finally used modelnet40_ply_hdf5_2048.zip on https://shapenet.cs.stanford.edu/media/modelnet40_ply_hdf5_2048.zip which I found on https://github.com/charlesq34/pointnet/blob/master/provider.py, and rewrote this: https://github.com/fxia22/pointnet.pytorch/blob/f0c2430b0b1529e3f76fb5d6cd6ca14be763d975/pointnet/dataset.py#L167

Can you give me the code you rewrote please?

lmomoy avatar Apr 10 '21 03:04 lmomoy

@QiWang-SJTU No. I still wonder why they use *.ply to load modelnet40. I finally used modelnet40_ply_hdf5_2048.zip on https://shapenet.cs.stanford.edu/media/modelnet40_ply_hdf5_2048.zip which I found on https://github.com/charlesq34/pointnet/blob/master/provider.py, and rewrote this:

https://github.com/fxia22/pointnet.pytorch/blob/f0c2430b0b1529e3f76fb5d6cd6ca14be763d975/pointnet/dataset.py#L167

Hi, I know this is a very old issue, but could you please tell me how you rewrote this? I have that dataset, but I can't get it to work.

discretehorse avatar Nov 11 '21 03:11 discretehorse