lzccccc / 3d-bounding-box-estimation-for-autonomous-driving

3d bounding box estimation from monocular image based on 2d bounding box
127 stars 36 forks source link

Can't train kitti data? #5

Open yeyewen opened 4 years ago

lzccccc commented 4 years ago

Hi, I don't understand your question.

yeyewen commented 4 years ago

Hi!I use your code to train KITTi,the data folder is just like the format as you posted. But thIS error img = cv2.resize(img, (cfg().norm_h, cfg().norm_w)) cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' happens during my training , when I use small subset of kitti(700 images).I can train more than 12 epochs. But more than 7000 images,this error occours. Some times it can train more than one epoch,but then the error happens. I print the image folder,but I can't find the bug.

yeyewen commented 4 years ago

Hi, in the middle of 7 epoch training,this error happens again File "train.py", line 61, in <module> train() File "train.py", line 58, in train max_queue_size=3) File "D:\Anaconda\envs\TF1.12\lib\site-packages\tensorflow\python\keras\engine\training.py", line 2177, in fit_generator initial_epoch=initial_epoch) File "D:\Anaconda\envs\TF1.12\lib\site-packages\tensorflow\python\keras\engine\training_generator.py", line 147, in fit_generator generator_output = next(output_generator) File "D:\Anaconda\envs\TF1.12\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 831, in get six.reraise(value.__class__, value, value.__traceback__) File "D:\Anaconda\envs\TF1.12\lib\site-packages\six.py", line 686, in reraise raise value File "D:\Anaconda\envs\TF1.12\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 696, in _data_generator_task generator_output = next(self._generator) File "D:\3d-bounding-box-estimation-for-autonomous-driving\utils\data_generation.py", line 80, in data_gen image, dimension, orientation, confidence = prepare_input_and_output(all_objs[key], all_objs[key]['image'], File "D:\3d-bounding-box-estimation-for-autonomous-driving\utils\data_generation.py", line 37, in prepare_input_and_output img = cv2.resize(img, (cfg().norm_h, cfg().norm_w)) cv2.error: OpenCV(3.4.2) C:\Miniconda3\conda-bld\opencv-suite_1534379934306\work\modules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' Any body any ideas?

lzccccc commented 4 years ago

This is caused by the random jitter factor when cropping images. In the pull request you might find the solution, but I have not checked if it is correct.