Closed yicheng6o6 closed 2 years ago
Hi, I think this is because of the implementation of the PLY loader. I simply assume the input PLY files are in Unicode format with fixed header information while your PLY may have different headers. You can re-write the function load_ply_points(pc_filepath, expected_point=2000) defined in FileRW.py based on your PLY header information. Just make sure this function returns an N*3 NumPy array (N is fixed) that stores xyz point locations.
For your reference, here is a general PLY loader: https://github.com/dranjan/python-plyfile
Hi, I encountered the same problem. I just used the data you provided here https://github.com/clinplayer/Point2Skeleton/tree/master/data
The problem disappears if I run
python test.py
instead of
python test.py --pc_list_file ../data/data-split/all-test.txt --data_root ../data/pointclouds/ --point_num 2000 --skelpoint_num 100 --gpu 0 --load_skelnet_path ../weights/weights-skelpoint.pth --load_gae_path ../weights/weights-gae.pth --save_result_path ../results/
The problem disappears if I run
python test.py
instead ofpython test.py --pc_list_file ../data/data-split/all-test.txt --data_root ../data/pointclouds/ --point_num 2000 --skelpoint_num 100 --gpu 0 --load_skelnet_path ../weights/weights-skelpoint.pth --load_gae_path ../weights/weights-gae.pth --save_result_path ../results/
Hey, could you explain your problem more clearly? Did you mean it worked if you run the later full command?
No, it worked if I run python test.py
.
Hi, @clinplayer Thank you very much for your reply:)
I'm wondering how to check header information? I use ros to record point cloud into a rosbag file, so I may need convert it into PLY format.
I can replay my bag files and use rostopic echo
May i have your suggestions? Any help is much appreciated:)
Hi, @trung6 Thank you very much for your reply:)
Yes, it worked if I run python test.py only, but I don’t know why.
Hi, @yicheng6o6 I found out why this happened. In test.py line 22, Just changing the type of argument --point_num from str to int can solve the type error.
Hi, @yicheng6o6 I found out why this happened. In test.py line 22, Just changing the type of argument --point_num from str to int can solve the type error.
Thanks for pointing out this issue! Now it is fixed. Thanks! @brian220
When I run python test.py... I met: GPU Number: 1 GPUs! Traceback (most recent call last): File "test.py", line 103, in
for iter, batch_data in enumerate(data_loader):
File "/home/dodo/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 517, in next
data = self._next_data()
File "/home/dodo/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/dodo/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/dodo/.local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/dodo/Point2Skeleton/code/DataUtil.py", line 17, in getitem
data_pc = rw.load_ply_points(self.data_folder + self.data_id[index] + '.ply', expected_point=self.point_num)
File "/home/dodo/Point2Skeleton/code/FileRW.py", line 167, in load_ply_points
pts = np.zeros((expected_point, 3), np.float64)
TypeError: 'str' object cannot be interpreted as an integer
May i have your suggestions to fix this problem?
Best wishes, Yicheng