tusen-ai / SimpleTrack

MIT License
345 stars 64 forks source link

Question about detection in Nuscenes #37

Closed lyx-louis closed 1 year ago

lyx-louis commented 1 year ago

Hello, sir! I'm learning your code, in the detection part, you wrote in data_preprocess.md that the command is like this:

cd preprocessing/nuscenes_data python detection.py --raw_data_folder ${raw_data_dir} --data_folder ${data_dir_2hz} --det_name ${name} --file_path ${file_path} --mode 2hz --velo

i have downloaded the nuscences data you published by dropbox, and move it to SimpleTrack directory. So I entered following command: python detection.py --raw_data_folder /mnt/yrfs/nuscenes/src_data/nuscenes/ --data_folder data_dir_2hz --det_name lyx_track --file_path ../../nuscenes/validation_2hz/center_point_detection.json --mode 2hz --velo

It returns to me an error that "ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (40,) + inhomogeneous part."

Could you pls tell me what's the problem it is?

ziqipang commented 1 year ago

@lyx-louis Sure, let me check this. Could you please re-do the whole procedure (from the step of git clone) and provide me a full screen shot and log of the process and error? It is a bit difficult for me to check the error with limited information.

lyx-louis commented 1 year ago

ok i will re-do it. pls wait a moment

lyx-louis commented 1 year ago

Ok sir, i re-did it and found that it works and in the directory below the detection, it generate a lot of scene-xxx.npz fichiers, is that the correcte result? In fact i found that it maybe because the conda enviorment, in the previous enviorment, python version is 3.6, it report the error like this: python detection.py --raw_data_folder /mnt/yrfs/nuscenes/src_data/nusce nes/ --data_folder data_dir_2hz --det_name lyxsimple --file_path ../../nuscenes/ validation_2hz/center_point_detection.json --mode 2hz --velo LOADING RAW FILE PROCESSING... 100%|████████████████████████████████████| 6019/6019 [00:00<00:00, 11627.23it/s] SAVING... 0%| | 0/150 [00:00<?, ?it/s] Traceback (most recent call last): File "detection.py", line 104, in main(args.det_name, args.file_path, detection_folder, args.data_folder, args .mode) File "detection.py", line 90, in main np.savez_compressed(os.path.join(output_folder, '{:}.npz'.format(scene_name) ), File "<__array_function__ internals>", line 200, in savez_compressed File "/home/win/Softwares/anaconda/envs/simpletrack/lib/python3.8/site-package s/numpy/lib/npyio.py", line 686, in savez_compressed _savez(file, args, kwds, True) File "/home/win/Softwares/anaconda/envs/simpletrack/lib/python3.8/site-package s/numpy/lib/npyio.py", line 716, in _savez val = np.asanyarray(val) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (40,) + inhomoge neous part. 0%| | 0/150 [00:00<?, ?it/s]

and when i change another enviorment, it report that:

python detection.py --raw_data_folder /mnt/yrfs/nuscenes/src_data/nuscenes/ -- data_folder data_dir_2hz --det_name lyxsimple --file_path ../../nuscenes/validat ion_2hz/center_point_detection.json --mode 2hz --velo LOADING RAW FILE PROCESSING... 100%|████████████████████████████████████| 6019/6019 [00:00<00:00, 12032.48it/s] SAVING... 0%| | 0/150 [00:00<?, ?it/s] /home/win/Softwares/anaconda/lib/python3.9/site-packages/numpy/lib/npyio.py:719: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (wh ich is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. val = np.asanyarray(val) 100%|█████████████████████████████████████████| 150/150 [00:04<00:00, 35.03it/s]

Could you pls confirm the result? thx alot

I compare the version between this 2 conda enviorment The first one (which report error ). numpy version is 1.24.3,filterpy = 1.4.5, shapely =1.8.5, numba = 0.57.0 pyquaternion=0.9.9 and nuscenes-devkit=1.1.10, python = 3.8.16

And for the second one, numpy version is 1.21.6,filterpy = 1.4.5, shapely =1.8.5, numba = 0.55.1 pyquaternion=0.9.9 and nuscenes-devkit=1.1.10,python=3.9.12

ziqipang commented 1 year ago

@lyx-louis Yes, this result looks good to me.