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

Error in tools/test_lanenet.py #10

Closed
cookfish opened this issue Nov 30, 2018 · 12 comments
Closed

Error in tools/test_lanenet.py #10

cookfish opened this issue Nov 30, 2018 · 12 comments

Comments

@cookfish
Copy link

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
`

@cardwing
Copy link
Owner

cardwing commented Dec 1, 2018

@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.

@chokkarapu
Copy link

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

@cardwing
Copy link
Owner

cardwing commented Dec 1, 2018

@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.

@cookfish
Copy link
Author

cookfish commented Dec 1, 2018

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

@cardwing
Copy link
Owner

cardwing commented Dec 1, 2018

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

@cookfish
Copy link
Author

cookfish commented Dec 1, 2018

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:])

@cardwing
Copy link
Owner

cardwing commented Dec 1, 2018

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

@cookfish
Copy link
Author

cookfish commented Dec 1, 2018

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

@cardwing
Copy link
Owner

cardwing commented Dec 1, 2018

Yes.

@zijianzhang
Copy link

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

@cardwing
Copy link
Owner

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

@SuperPengXue
Copy link

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

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

5 participants