gsplat icon indicating copy to clipboard operation
gsplat copied to clipboard

I encountered the following error: Input quaternary should be a 3- or 4-vector

Open Aaasukaa opened this issue 1 year ago • 4 comments

I encountered the following error: Input quaternion should be a 3- or 4-vector, when I tried to render my own colmap data using simple_trainer.py

May I ask what the problem is?

Thank you !

Image

Image

Aaasukaa avatar Apr 25 '25 07:04 Aaasukaa

Firstly make sure you are using this fork of the pycolmap: https://github.com/nerfstudio-project/gsplat/blob/e2d395258617566206e1ffc97260c374500fc163/examples/requirements.txt#L4

Secondly make sure your date is in colmap format.

liruilong940607 avatar Apr 25 '25 20:04 liruilong940607

Interesting, I got exactly the same problem and I have installed the correct requirements for the gsplat examples as @liruilong940607 explained. I'm using VGGT (https://github.com/facebookresearch/vggt) to create the colmap data. What are you using @Aaasukaa? Maybe there is a problem but I dont see it.

Image list with two lines of data per image:

IMAGE_ID, QW, QX, QY, QZ, TX, TY, TZ, CAMERA_ID, NAME

POINTS2D[] as (X, Y, POINT3D_ID)

Number of images: 8, mean observations per image: 12629.0

1 0.9999999987256754 -4.755071114699499e-05 -2.962220715568456e-06 -1.669743685078861e-05 0.00014839165669400245 -0.00010269899939885363 -0.00012449866335373372 1 20250401_082628.jpg 0 0 1 4 0 2 8 0 3 12 0 4 16 0 5 20 0 6 24 0 7 28 0 8 32 0 9 36 0 10 40 0 11 44 0 12 48 0 13 52 0 14 56 0 15 60 0 16 64 0 17 68 0 18 72 0 19 76 0 20 80 0 21 84 0 22 88 0 23 92 0 24 96 0 25 100 0 26 104 0 27 108 0 28 112 0 29 116 0 30 120 0 31 124 0 32 128 0 33 132 0 34 136 0 35 140 0 36 144 0 37 148 0 38 152 0 39 156 0 40 160 0 41 164 0 42 168 0 43 172 0 44 176 0 45 180 0 46 184 0 47 188 0 48 192 0 49 196 0 50 200 0 51 204 0 52 208 0 53 212 0 54 216 0 55 220 0 56 224 0 57 228 0 58 232 0 59 236 0 60 240 0 61 244 0 62 248 0 63 252 0 64 256 0 65 260 0 66 264 0 67 268 0 68 272 0 69 276 0 70 280 0 71 284 0 72 288 0 73 292 0 74 296 0 75 300 0 76 304 0 77 308 0 78 312 0 79 316 0 80 320 0 81 324

This is when I use a textbased file format. When I switch to a binary format I get this error message: scene_manager.py", line 162, in _load_images_bin points_array.fromfile(f, 3 * num_points2D) OverflowError: Python int too large to convert to C ssize_t

Something seems to be off, but IDK yet.

Did you find any solution yet?

TheFloHub avatar Apr 29 '25 13:04 TheFloHub

I changed the lines to

                    image = Image(data[-1], int(data[-2]),
                                  Quaternion(np.array(data[1:5], dtype=np.float64)),
                                  np.array(data[5:8], dtype=np.float64))

and it seems to work for now but I got more errors now. The authors mainly uses pythons map functionality but somethow it doesn't work for me. I wonder where the difference comes from. I guess the code is tested well. My numpy version is 1.26.3 which is also less than 2 as described in to requirements file.

TheFloHub avatar Apr 29 '25 14:04 TheFloHub

It seems solved in https://github.com/rmbrualla/pycolmap/pull/6

fisheatmice avatar Sep 03 '25 06:09 fisheatmice