fxia22 / pointnet.pytorch

pytorch implementation for "PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation" https://arxiv.org/abs/1612.00593
MIT License
2.13k stars 630 forks source link

When I run show_cls.py #29

Open mxg007 opened 5 years ago

mxg007 commented 5 years ago

teacher: When I run show_cls.py i:1 loss: 2.079445 accuracy: 0.031250 i:2 loss: 2.079467 accuracy: 0.000000 i:3 loss: 2.079436 accuracy: 0.062500 i:4 loss: 2.079478 accuracy: 0.000000 i:5 loss: 2.079460 accuracy: 0.000000 i:6 loss: 2.079444 accuracy: 0.000000 i:7 loss: 2.079463 accuracy: 0.000000 i:8 loss: 2.079488 accuracy: 0.000000 i:9 loss: 2.079418 accuracy: 0.062500 i:10 loss: 2.079412 accuracy: 0.031250 """ """ why is that?

Yaoxingtian commented 5 years ago

我也是这个问题 ,请问你解决了吗 ?

Yaoxingtian commented 5 years ago

你把里面的代码改为 correct = target.eq(pred_choice.data).cpu().sum().data.numpy() 就可以了,增加.data.numpy()

albertotono commented 3 years ago

when I run show_cls.py I got initially this FileNotFoundError: [Errno 2] No such file or directory: 'shapenetcore_partanno_segmentation_benchmark_v0/synsetoffset2category.txt'

did you run into the same issue? @Yaoxingtian and @mxg007

albertotono commented 3 years ago

Ok , I solved it changing root

test_dataset = ShapeNetDataset(
    root='**/-------**/shapenetcore_partanno_segmentation_benchmark_v0',
    split='test',
    classification=True,
    npoints=opt.num_points,
    data_augmentation=False)

but I have this message pickle.UnpicklingError: invalid load key, '-'. and also this

I am pointing to this file pointnet.pytorch/utils/cls/cls_model_3/archive/data.pkl created after the training

pickle.UnpicklingError: A load persistent id instruction was encountered,
but no persistent_load function was specified.

EDIT- Solved Ok it is better to point to the .pth directly instead of the .pkl file

I got this results. i:89 loss: 0.014647 accuracy: 0.812500

and if you want to visualize each classes in the batch of 32 you can add this to the print print('i:%d loss: %f accuracy: %f prediction: %s' % (i, loss.data.item(), correct / float(32), target)) the number are related to the 16th classes.

albertotono commented 3 years ago

if you want to classify a single object I would recommend this notebook