cardwing/Codes-for-Lane-Detection

Error in tools/test_lanenet.py

cookfish opened this issue · 12 comments

An error seems trace back to line 70 in tools/test_lanenet.py: binary_seg_ret, instance_seg_ret = net.inference(input_tensor=input_tensor, name='lanenet_loss')

My command is python3 tools/test_lanenet.py --weights_path ~/test-model-68-8/culane_lanenet_vgg_2018-11-27-16-03-42.ckpt-76000 --image_path demo_file/test_img.txt --batch_size 1 --use_gpu 0

Here is the link of Traceback >> log.txt
`

@cookfish , batch_size should be set as 8. The batch_size used in training and testing is the same since I specify the batch_size channel in the training process.

@cardwing : So whatever the batch size we set during training, the same batch size we need to keep during testing, is does you mean?

@chokkarapu , yes. But if you do not specify the batch size dimension in the training process (the construction of graph), you can use arbitrary batch size during testing. See here for detailed explanations.

Hi, another error occurred after I set batch_size to 8,
INFO:tensorflow:Restoring parameters from /home/caffe/test-model-68-8/culane_lanenet_vgg_2018-11-27-16-03-42.ckpt-76000 I1201 14:15:51.896539 3476 tf_logging.py:115] Restoring parameters from /home/caffe/test-model-68-8/culane_lanenet_vgg_2018-11-27-16-03-42.ckpt-76000 OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file /io/opencv/modules/imgproc/src/imgwarp.cpp, line 3492 Traceback (most recent call last): File "tools/test_lanenet.py", line 141, in <module> test_lanenet(args.image_path, args.weights_path, args.use_gpu, img_name, args.batch_size) File "tools/test_lanenet.py", line 101, in test_lanenet for tmp in gt_imgs] File "tools/test_lanenet.py", line 101, in <listcomp> for tmp in gt_imgs] cv2.error: /io/opencv/modules/imgproc/src/imgwarp.cpp:3492: error: (-215) ssize.width > 0 && ssize.height > 0 in function resize

@cookfish , it seems that the image is read incorrectly. Please check your image path.

got it, why you cut img_path[0] off in test_img.txt ? checkout line 51 in lanenet_data_processor_test.py gt_img_list.append(info_tmp[0][1:])

@cookfish , it depends on the content of your image list. In my case, I need to remove '/' in the image path.

well, just a suggestion, it's better to use absolute path

Yes.

我用绝对路径也会有这个问题。。

@zijianzhang, just check the image path and the problem should be fixed easily.

I tried many ways, batch size cannot be set to 1 in test,is the net special? or I didn't find the right way.
any advice?@cardwing @cardwing thanks for your reply