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

The errors when I did test. #5

Open
yingning opened this issue Dec 27, 2017 · 5 comments
Open

The errors when I did test. #5

yingning opened this issue Dec 27, 2017 · 5 comments

Comments

@yingning
Copy link

The following is code that I used for testing the model after training.
from config import config
from shintb import graph_drawer, default_box_control, svt_data_loader, runner,output_drawer
import tensorflow as tf
flags = tf.app.flags
FLAGS = flags.FLAGS
graphdrawer = graph_drawer.GraphDrawer(config)
dataloader = svt_data_loader.SVTDataLoader('./svt2/train.xml','./svt2/test.xml')
dbcontrol = default_box_control.DefaultBoxControl(config, graphdrawer)
outputdrawer = output_drawer.OutputDrawer(config, dbcontrol)
runner = runner.Runner(config, graphdrawer, dataloader, dbcontrol,outputdrawer)
flags.DEFINE_integer("iter", 10000, "iteration for job")
runner.test(FLAGS.iter)

But I have the following errors:
/home/jsj/shinTB/shintb/utils/box_calculation.py:52: RuntimeWarning: invalid value encountered in double_scalars
right = min(r1[0] + r1[2], r2[0] + r2[2])
/home/jsj/shinTB/shintb/utils/box_calculation.py:53: RuntimeWarning: invalid value encountered in double_scalars
bottom = min(r1[1] + r1[3], r2[1] + r2[3])
PICKED BOXES INFO : [([-inf, 4260720.561588916, inf, 0.044721359549995794], 0.49975014, 0)]
/home/jsj/shinTB/shintb/output_drawer.py:103: RuntimeWarning: invalid value encountered in double_scalars
rect_end = (x+w, y+h)
Traceback (most recent call last):
File "/home/jsj/shinTB/new_file_for_test.py", line 12, in
runner.test(FLAGS.iter)
File "/home/jsj/shinTB/shintb/runner.py", line 196, in test
self.outputdrawer.draw_outputs(test_imgs[0], output_boxes, output_confidence, wait=1)
File "/home/jsj/shinTB/shintb/output_drawer.py", line 104, in draw_outputs
I = cv2.rectangle(I, rect_start, rect_end, (255, 0, 0) , 5 )
TypeError: integer argument expected, got float.

Can you help me fix the problem?
@shinjayne

@FantDing
Copy link

yeah, I find the problem as well. I changed some lines like these in output_drawer.py. It can run normally, but I am not sure how the changes do harms to the results.
rect_start = (int(x),int(y)) rect_end = (int(x+w), int(y+h)) # rect_start = (x,y) # rect_end = (x+w, y+h)

@fanw52
Copy link

fanw52 commented Jan 29, 2018

hello, I also have run into this problem when I run test project.Have you solved this problem? please help me. thanks

@fanw52
Copy link

fanw52 commented Jan 29, 2018

@yingning @FantDing @shinjayne Thank you for your attention

@BZF8989
Copy link

BZF8989 commented Jun 4, 2018

I am having this issue as well. I tried to find a different way of approaching it but it always seems to want an integer.

@DavidSeas
Copy link

DavidSeas commented Jul 7, 2018

I temporary fix the problem this way

for box, conf, top_label in picks : try: x, y, w, h = box[0] ,box[1], box[2], box[3] print("x: ", x) print("y: ", y) print("w: ", w) print("h: ", h) rect_start = (x,y) rect_end = (x+w, y+h) rect_start_int=(int(rect_start[0]),int(rect_start[1])) rect_end_int=(int(rect_end[0]),int(rect_end[1])) I = cv2.rectangle(I, rect_start_int, rect_end_int, (255, 0, 0) , 5 ) print("Textboxes information!") print("rect_start : ", rect_start , "// rect_end :", rect_end) print("confidence: ", conf) except OverflowError: print("Overflow")

This avoid the overflow exception and show textboxes while I try to undestand where is the problem

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