yolo_tensorflow icon indicating copy to clipboard operation
yolo_tensorflow copied to clipboard

Some problems occurred in testing

Open SimonPrPr opened this issue 8 years ago • 13 comments

Hi, im interested in your amazing project. I've trained a model followed by your steps. But when i tried to test the model. It seems that nothing was detected in the picture. However, run the test.py with YOLO_small.ckpt is OK. But I cannot detect anything with save.ckpt-15000 etc. i changed nothing in your train.py. could you tell me what's possibly going wrong?

SimonPrPr avatar May 25 '17 05:05 SimonPrPr

hi simon, did you solve the problem? i have the seem question ,i changed the input data code(only train 'car' and 'cat'),but after the trainning,nothing can be detected

joashchn avatar May 31 '17 09:05 joashchn

Hi Simon, did you solve the problem? Because I am facing the same problem. So I changed MAX_ITER from 15000 to 30000 in my configuration, but the loss was not reduced to less than about 9 and could not detect anything in this train.

jongsukchoi avatar Jun 27 '17 03:06 jongsukchoi

@joashchn @jongsukchoi unfortunately, i did not solve the problem```

SimonPrPr avatar Jul 03 '17 07:07 SimonPrPr

I have the same problem. I have tried fine tune from YOLO_small.ckpt, the model could detect objects but it performed a little worse than YOLO_small.ckpt

sguuaa avatar Aug 17 '17 06:08 sguuaa

I have the same problem... I use my trained weight (save.ckpt-15000) for testing, but nothing detected...@@ Is loss too high? (about 10) Have anyone solved the problem?

ghost avatar Nov 17 '17 09:11 ghost

@NickZhung I trained the dataset, but I don't know which is the trained model. when I complete the training, I get three file after the last iteration. they are save.ckpt-15000.data-00000-of-00001,save.ckpt-15000.index and save.ckpt-15000.meta. which file should I use as the model for testing ? Help!

passion3394 avatar Nov 28 '17 01:11 passion3394

I think I have solute my own problem. In test.py, modify the following two lines like this: parser.add_argument('--weights', default="save.ckpt-15000", type=str) parser.add_argument('--weight_dir', default='pascal_voc/output/2017_11_26_09_36/', type=str)

passion3394 avatar Nov 28 '17 02:11 passion3394

@passion3394 Do you use the pre training weighs? and how much is the final loss? Is the test effect number good

ss199302 avatar Nov 28 '17 12:11 ss199302

I have the same problems with you. I thought the weight that I trained without pre-training was not good that cause the problem(detect nothing).Then I changed the parameter‘THRESHOLD ’(in the config file) to 0.01,it did work!Although the result was not right!So my conclusion is if our loss can arrive about 6(with pre——training),the weight can be good enough to detect !

Liu-Yicheng avatar Nov 29 '17 03:11 Liu-Yicheng

@passion3394 Thank you for your advice.I successfully run the test.py thought the result is not satisfied.

BlankAix avatar Jan 26 '18 01:01 BlankAix

edit config.py,just as this:

#WEIGHTS_FILE = None WEIGHTS_FILE = os.path.join(DATA_PATH, 'weights', 'YOLO_small.ckpt')

when turn on the pre-training weights YOLO_small.ckpt,the trained model can make effect!

my test.py which use the trained model ,just like this:

class Detector(object):

def __init__(self, net, weight_file):
    self.net = net
    self.weights_file = weight_file

    self.classes = cfg.CLASSES
    self.num_class = len(self.classes)
    self.image_size = cfg.IMAGE_SIZE
    self.cell_size = cfg.CELL_SIZE
    self.boxes_per_cell = cfg.BOXES_PER_CELL
    self.threshold = cfg.THRESHOLD
    self.iou_threshold = cfg.IOU_THRESHOLD
    self.boundary1 = self.cell_size * self.cell_size * self.num_class
    self.boundary2 = self.boundary1 + self.cell_size * self.cell_size * self.boxes_per_cell

    self.sess = tf.Session()
    self.sess.run(tf.global_variables_initializer())
         
    PATH = **'/media/stockerc/f/wz/project/yolo/data/pascal_voc/output/2018_02_23_11_13'
    print 'Restoring weights from: ' + PATH
    self.saver = tf.train.Saver()
    ckpt = tf.train.get_checkpoint_state(PATH)
    self.saver.restore(self.sess, ckpt.model_checkpoint_path)

zy486at189cn avatar Feb 23 '18 03:02 zy486at189cn

I have the same question(no bounding-box in the test_pic)!and I used 1.5h to debug and figure this problem... I checked the path problem. I finally found that if i change "THRESHOLD and IOU_THRESHOLD " in the configure.py, i can get the bounding-box(although it totally wrong) . So i guess the threshold is the probability threshold to show the box and the iou_threshold is the threshold to merge the boxes. I hope this will help you image

boringzly avatar Apr 26 '18 15:04 boringzly

Hi Simon, did you solve the problem? Because I am facing the same problem. So I changed MAX_ITER from 15000 to 30000 in my configuration, but the loss was not reduced to less than about 9 and could not detect anything in this train.

I try it ,and MAX_ITER was set 50000, but loss was not reduced to less than about 9, and not detect anything too

guker avatar Mar 14 '19 01:03 guker