Open mxg007 opened 5 years ago
我也是这个问题 ,请问你解决了吗 ?
你把里面的代码改为 correct = target.eq(pred_choice.data).cpu().sum().data.numpy() 就可以了,增加.data.numpy()
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
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.
if you want to classify a single object I would recommend this notebook
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?