Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid lidar file for exporting to kitti #89

Open
hcyoo93 opened this issue Aug 1, 2020 · 5 comments
Open

Invalid lidar file for exporting to kitti #89

hcyoo93 opened this issue Aug 1, 2020 · 5 comments

Comments

@hcyoo93
Copy link

hcyoo93 commented Aug 1, 2020

regarding #50 issue,

The same error comes up as below

points = scan.reshape((-1, 5))[:, : cls.nbr_dims()]
ValueError: cannot reshape array of size 265728 into shape (5)

I am informed from #50 that the latest version of the Lyft dataset should be OK with this issue.

However, I got the same issue with the newest version(downloaded in July 2020).

As far as I know, the previous version has its folder name as v1.01-train/lidar which is different from mine: train/train_lidar.

How can I resolve this? Any comments are welcome!

@tobii95
Copy link

tobii95 commented Sep 9, 2020

Hey!
I'm facing the same problem. I am also using the newest version of the dataset.
Do you have a solution for it?

@hcyoo93
Copy link
Author

hcyoo93 commented Sep 9, 2020

Hi @tobii95

I have no idea about this issue.

Maybe we can skip some problematic frames for exporting.
(I remember this occurs only for some frames... not every frame)

@mnik17
Copy link

mnik17 commented Jul 9, 2021

Hey @tobii95 and @hcyoo93,

I just downloaded the dataset a few weeks ago, but I got the exact same error when trying to convert it to KITTI format. Have you been able to find a solution and if not is it possible to just skip the affected frames?

@tobii95
Copy link

tobii95 commented Jul 9, 2021

Hey @mnik17 ,

some time has pased, so I don't remember the issue in detail anymore. But as I remember it, I just skipped the affected frames and that worked for me

@csonthomisi
Copy link

I just faced the problem, and I solved it in an easy way.. I modified the function "def from_file" in the following way:

      def from_file(cls, file_name: Path) -> "LidarPointCloud":
              """Loads LIDAR data from binary numpy format. Data is stored as (x, y, z, intensity, ring index).
      
              Args:
                  file_name: Path of the pointcloud file on disk.
      
              Returns: LidarPointCloud instance (x, y, z, intensity).
      
              """
      
              assert file_name.suffix == ".bin", "Unsupported filetype {}".format(file_name)
      
              scan = np.fromfile(str(file_name), dtype=np.float32)
              try:
                  points = scan.reshape((-1, 5))[:, : cls.nbr_dims()]
              except:
                  l = len(scan)//5
                  points = scan[:5*l].reshape((-1, 5))[:, : cls.nbr_dims()]
                  print("Error solved in {}".format(file_name))
              return cls(points.T)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants