Closed jonathanslee4 closed 4 years ago
Please see Andres's comment https://github.com/PRBonn/lidar-bonnetal/issues/62#issuecomment-683716148:
As for the labels for inference, they are there for another script that used them for evaluation directly after inference, but this will not work on the test set. It is a bug that I have fixed internally but have not released yet. It is solved by making
gt=True,
intogt=False
in this line.
Hope that fixes your issue.
I'm getting a new error from changing that line:
File "../..//tasks/semantic/dataset/kitti/parser.py", line 290, in init assert len(self.validloader) > 0 AssertionError
Any advice? Thank you for the help.
The code expects the "normal" semantic kitti folders, thus it loads also the validation data and check if the data is there. an easy fix would be if you modify the semantic-kitti.yaml such that train valid and test contain your sequence folder.
Thus if you created an folder 00 containing your scans, just put there under train, valid and test 0. That should fix the problem.
Did you mean to add "-00" to the train, valid, and test sections? I tried that and unfortunately received the same error. The path to my scan file is /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/sequences/00/velodyne.
Sorry, I currently have here the repo not running, thus have to deduce from looking at the code.
split: # sequence numbers
train:
- 0
valid:
- 0
test:
- 0
And you should edit the data_cfg.yaml
in your squeezeseg model folder. Sorry for the confusion.
Here's what I'm getting now.
FileExistsError: [Errno 17] File exists: '/Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/labels/sequences/00'
All I'm doing is trying to get labels on a single lidar scan, which is a file called 000000.bin in /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/sequences/00/velodyne. I'm using the squeezeseg model, which I've put in the semantic directory. I also created an empty folder called labels in the semantic directory, which I write the path to when I run infer.
the log folder already exists. (It should be deleted, but appearently this did not happen. You are using windows? Might be that it does not support rmtree?) Try to use a log folder that does not exist (e.g., -l /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/log).
I tried that, with a similar error: FileExistsError: [Errno 17] File exists: '/Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/log/sequences/00'
It looks like wherever I specify the path for the label folder, a new folder called sequences gets created which has a subfolder called 00. In the subfolder is another folder called predictions: /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/log/sequences/00/predictions
ah okay. I see what is the problem: now train, valid and test are 0. as infer is always doing inference for train, valid, and test, one needs also dedicated subsets. as a workaround you can copy your 00 folder to 01, and 02 and then set in the data_cfg.yaml:
split: # sequence numbers
train:
- 0
valid:
- 1
test:
- 2
As said before, the code works with the "normal" semantic kitti structure which has distinct train, validation and test sequences.
I got another error, but I'm definitely making progress!
File "../..//tasks/semantic/dataset/kitti/parser.py", line 290, in init assert len(self.validloader) > 0
I changed data_cfg.yaml as advised. Here is my current folder structure:
I'm running this command: ./infer.py -d /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/ -l /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/log -m /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/squeezeseg
you should have at least 1 scan in the fake validation set folder or testset folder.
I don't think I have those folders. Should I create them, and if so, in which directory?
Actually, I just understood and fixed the error, and got the label files to show up. The thing now is that when I run visualize, I receive the following error:
Traceback (most recent call last):
File "./visualize.py", line 129, in
The command I'm running is: ./visualize.py -d /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/ -p /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/log
Thank you so much for the help.
Here are some pointers to fix the problem:
label_names
and scan_names
to figure out what is missing.Thank you for your discussion. I also solved the similar problem, but I also want to ask how to convert the point_cloud2 lidar data into bin file.
Run a ROS node consuming the lidar point clouds and each meassage into a file containing x,y,z,r as binary floats. your file should contain only the cordinates x,y,z and the remission r of each point. (if now remission, simply use 0.5 or some other constant.)
Since your original problem seems to be solved, I will now close this issue. Feel free to open a new issue or reopen this issue again if you still experience problems with infer.
Sorry to bother you again, I generated the bin file like this:
int32_t num = 64*2048;//1000000
float *data = (float*)malloc(num*sizeof(float));
pcl::PointCloud<pcl::PointXYZI>::Ptr cloud1(new pcl::PointCloud<pcl::PointXYZI>);
pcl::fromROSMsg (*msg, *cloud1);
for(int i=0;i < cloud1->points.size();i++){
*(data+4*i+0)=cloud1->points[i].x;
*(data+4*i+1)=cloud1->points[i].y;
*(data+4*i+2)=cloud1->points[i].z;
*(data+4*i+3)=cloud1->points[i].intensity;
}
But the program will report an error like this:
IndexError: index -2147483648 is out of bounds for axis 0 with size 64
What can I do to make sure the index is in range? thanks
it is really hard to understand where the problem is happening. Please provide also the stack trace.
And in your c++ code, I would replace the pointer-based data array with an std::vector<float>
, which you can even resize to 4*cloud1->size()
appropriately or simply use push_back()
@he-guo Did you solve the index error ? :) Eager to hear from you soon.
I'm having trouble running infer.py. Here is what I'm running: ./infer.py -d /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/ -l /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/labels -m /Users/jonathan/desktop/asl/lidar-bonnetal/train/tasks/semantic/squeezeseg
And here is the error: File "../..//tasks/semantic/dataset/kitti/parser.py", line 101, in init assert(len(scan_files) == len(label_files)) AssertionError
I'm using a .bin file of a single lidar scan for the dataset, which is located in the semantic/sequences/00/velodyne folder. Any pointers? Thank you for your time!