balancap / SSD-Tensorflow

Single Shot MultiBox Detector in TensorFlow
4.11k stars 1.89k forks source link

NameError: name 'ssd_anchors' is not defined #190

Open fightingxyq opened 6 years ago

fightingxyq commented 6 years ago

win10,anaconda4.3.2,python3.6,tensorflow gpu,cuda9,cudnn7 When Use jupyter Notebook SSD run a test case

  1. Download the model ssd_300_vgg, stored in SSD-Tensorflow-master / checkpoints / this directory
  2. Open the terminal, in the main directory SSD-Tensorflow-master, run cd notebooks / enter the noteboo directory, run jupyter-notebook into the http: // localhost: 8892 / tree server, open the ssd_notebook.ipynb.ipynb file
  3. cell all but there are some erros: ERROR! Session/line number was not unique in database. History logging moved to new session 17

NameError Traceback (most recent call last)

in () 4 5 img = mpimg.imread(path + image_names[-5]) ----> 6 rclasses, rscores, rbboxes = process_image(img) 7 8 # visualization.bboxes_draw_on_img(img, rclasses, rscores, rbboxes, visualization.colors_plasma) in process_image(img, select_threshold, nms_threshold, net_shape) 7 # Get classes and bboxes from the net outputs. 8 rclasses, rscores, rbboxes = np_methods.ssd_bboxes_select( ----> 9 rpredictions, rlocalisations, ssd_anchors, 10 select_threshold=select_threshold, img_shape=net_shape, num_classes=21, decode=True) 11 NameError: name 'ssd_anchors' is not defined Please help me,thanks
JockySama commented 6 years ago

The cell above may not be executed. see if one of the cells above is In[*]. I met the same problem and here is my solution.

Restore SSD model.

ckpt_filename = '../checkpoints/ssd_300_vgg.ckpt' I finally find that there is no file named 'ssd_300_vgg.ckpt' and you should put the file 'ssd_300_vgg.ckpt.index' into the specified directory,which is extracted from the compressed file.

wangxujin1221 commented 6 years ago

hello,I met the same question with you..I'm not really understand the solution,could you please help me,thanks!!!!

wangxujin1221 commented 6 years ago

I changed path like this ckpt_filename = '../checkpoints/VGG_VOC0712_SSD_300x300_iter_120000.ckpt' but the cell 6 always be In[*].And below cell6,it displays: INFO:tensorflow:Restoring parameters from ../checkpoints/VGG_VOC0712_SSD_300x300_iter_120000.ckpt,is it work right?please!

wangxujin1221 commented 6 years ago

i'v already solved this problem,thank you!

Michelexie commented 6 years ago

@wangsihfu hi, I met the exact problem like you put forward, i changed ckpt_filename = '../checkpoints/VGG_VOC0712_SSD_300x300_iter_120000.ckpt' but the cell 6 always be In[*].And below cell6,it displays: INFO:tensorflow:Restoring parameters from ../checkpoints/VGG_VOC0712_SSD_300x300_iter_120000.ckpt, can you tell me how you finally solved this problem?? thanks!!!