charlesq34 / pointnet

PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation
Other
4.64k stars 1.45k forks source link

Type Error : unsupported operand type(s) for + : range' and 'list' #229

Closed MyoungHaSong closed 4 years ago

MyoungHaSong commented 4 years ago

Thank you for sharing code.

After completing training in the Semantic segmentation task. I prepare dataset and run python batch_inference.py --model_path log6/model.ckpt --dump_dir log6/dump --output_filelist log6/output_filelist.txt --room_data_filelist meta/area6_data_label.txt --visu code However I got this Error

2020-01-04 17:50:16.022971: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7 eval mean loss: 0.384805 eval accuracy: 0.900179 /workspace/pointnet/data/stanford_indoor3d/Area_6_copyRoom_1.npy log6/dump/Area_6_copyRoom_1_pred.txt 12 eval mean loss: 1.555910 eval accuracy: 0.750468 /workspace/pointnet/data/stanford_indoor3d/Area_6_hallway_1.npy log6/dump/Area_6_hallway_1_pred.txt Traceback (most recent call last): File "batch_inference.py", line 171, in evaluate() File "batch_inference.py", line 81, in evaluate a, b = eval_one_epoch(sess, ops, room_path, out_data_label_filename, out_gt_label_filename) File "batch_inference.py", line 102, in eval_one_epoch current_data, current_label = indoor3d_util.room2blocks_wrapper_normalized(room_path, NUM_POINT) File "/workspace/pointnet/sem_seg/indoor3d_util.py", line 265, in room2blocks_wrapper_normalized random_sample, sample_num, sample_aug) File "/workspace/pointnet/sem_seg/indoor3d_util.py", line 241, in room2blocks_plus_normalized random_sample, sample_num, sample_aug) File "/workspace/pointnet/sem_seg/indoor3d_util.py", line 197, in room2blocks sample_data_label(block_data, block_label, num_point) File "/workspace/pointnet/sem_seg/indoor3d_util.py", line 129, in sample_data_label new_data, sample_indices = sample_data(data, num_sample) File "/workspace/pointnet/sem_seg/indoor3d_util.py", line 126, in sample_data return np.concatenate([data, dup_data], 0), range(N)+list(sample) TypeError: unsupported operand type(s) for +: 'range' and 'list'

what should I do ?

MyoungHaSong commented 4 years ago

Solved the problem. the problem is the code below. in indoor3d_util.py,

return np.concatenate([data, dup_data], 0), range(N)+list(sample) --> return np.concatenate([data, dup_data], 0), list(range(N)) + sample.tolist()