balancap / ssd-tensorflow Goto Github PK
View Code? Open in Web Editor NEWSingle Shot MultiBox Detector in TensorFlow
Single Shot MultiBox Detector in TensorFlow
Hi,
First, thanks for your hard work to implement SSD on TensorFlow, BIG CREDIT!
Now I want to train my own model on another data set.
when I finetune from vgg_16.ckpt, error with :Tensor name "ssd_300_vgg/conv2/conv2_2/biases" not found in checkpoint files ./vggmodel/vgg_16.ckpt.
how to solve this problem .thanks
I user tf 0.9 but some module doesn't exist, what version should I use, r1.0?
Thank you very much
I tried to use multi-GPUs by inserting num_clones=4 argument.
but, below error occurred.
InvalidArgumentError (see above for traceback): Cannot assign a device to node 'clone_3/ssd_losses/block_5/cross_entropy_neg/SparseSoftmaxCrossEntropyWithLogits/Gather': Could not satisfy explicit device specification '/device:GPU:3' because no supported kernel for GPU devices is available.
[[Node: clone_3/ssd_losses/block_5/cross_entropy_neg/SparseSoftmaxCrossEntropyWithLogits/Gather = Gather[Tindices=DT_INT32, Tparams=DT_INT32, validate_indices=true, _device="/device:GPU:3"](clone_3/ssd_losses/block_5/cross_entropy_neg/SparseSoftmaxCrossEntropyWithLogits/Shape_1, clone_3/ssd_losses/block_5/cross_entropy_neg/SparseSoftmaxCrossEntropyWithLogits/sub)]]
Could you advice for using multi-GPUs ?
I get the following error, is it a TF version issue?
My TF version is 0.12.
$ EVAL_DIR=./logs/
$ CHECKPOINT_PATH=./checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
$ python eval_ssd_network.py --eval_dir=${EVAL_DIR} --dataset_dir=${DATASET_DIR} --dataset_name=pascalvoc_2007 --dataset_split_name=test --model_name=ssd_300_vgg --checkpoint_path=${CHECKPOINT_PATH} --batch_size=1
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
{'batch_size': 1,
'checkpoint_path': './checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt',
'dataset_dir': './VOC2007/',
'dataset_name': 'pascalvoc_2007',
'dataset_split_name': 'test',
'eval_dir': './logs/',
'eval_image_size': None,
'eval_resize': 4,
'gpu_memory_fraction': 0.04,
'keep_top_k': 200,
'master': '',
'matching_threshold': 0.5,
'max_num_batches': None,
'model_name': 'ssd_300_vgg',
'moving_average_decay': None,
'nms_threshold': 0.45,
'num_classes': 21,
'num_preprocessing_threads': 4,
'preprocessing_name': None,
'remove_difficult': True,
'select_threshold': 0.01,
'select_top_k': 400,
'unrolled_lstm': False,
'wait_for_checkpoints': False}
{'anchor_offset': 0.5,
'anchor_ratios': [[2, 0.5],
[2, 0.5, 3, 0.3333333333333333],
[2, 0.5, 3, 0.3333333333333333],
[2, 0.5, 3, 0.3333333333333333],
[2, 0.5],
[2, 0.5]],
'anchor_size_bounds': [0.15, 0.9],
'anchor_sizes': [(21.0, 45.0),
(45.0, 99.0),
(99.0, 153.0),
(153.0, 207.0),
(207.0, 261.0),
(261.0, 315.0)],
'anchor_steps': [8, 16, 32, 64, 100, 300],
'feat_layers': ['block4', 'block7', 'block8', 'block9', 'block10', 'block11'],
'feat_shapes': [(38, 38), (19, 19), (10, 10), (5, 5), (3, 3), (1, 1)],
'img_shape': (300, 300),
'no_annotation_label': 21,
'normalizations': [20, -1, -1, -1, -1, -1],
'num_classes': 21,
'prior_scaling': [0.1, 0.1, 0.2, 0.2]}
['./VOC2007/voc_2007_test.tfrecord']
Traceback (most recent call last):
File "eval_ssd_network.py", line 346, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "eval_ssd_network.py", line 162, in main
difficults=None)
File "/home/nwkim/tensorflow-sample/SSD-Tensorflow/preprocessing/preprocessing_factory.py", line 59, in preprocessing_fn
is_training=is_training, **kwargs)
File "/home/nwkim/tensorflow-sample/SSD-Tensorflow/preprocessing/ssd_vgg_preprocessing.py", line 400, in preprocess_image
**kwargs)
File "/home/nwkim/tensorflow-sample/SSD-Tensorflow/preprocessing/ssd_vgg_preprocessing.py", line 322, in preprocess_for_eval
bboxes = tf.concat([bbox_img, bboxes], axis=0)
TypeError: concat() got an unexpected keyword argument 'axis'
Traceback (most recent call last):
File "train_ssd_network.py", line 23, in
import tf_utils
File "/opt/data/penggao/deep_detection/SSD-Tensorflow/tf_utils.py", line 65
print('\n# =========================================================================== #', file=stream)
^
SyntaxError: invalid syntax
I successfully predicted an image, but just got index rather than human read txts, I think it's more proper to write names label text on image, but I cannot find it. Should author consider add it into repo?
After that I have followed all the instructions of readme
running the following command:
EVAL_DIR=./logs/
CHECKPOINT_PATH=./checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
python eval_ssd_network.py \
--eval_dir=${EVAL_DIR} \
--dataset_dir=${DATASET_DIR} \
--dataset_name=pascalvoc_2007 \
--dataset_split_name=test \
--model_name=ssd_300_vgg \
--checkpoint_path=${CHECKPOINT_PATH} \
--batch_size=1
I get the error Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints
Here what I see in the console output:
# =========================================================================== #
# Training | Evaluation dataset files:
# =========================================================================== #
['VOC2007/test/voc_2007_test.tfrecord']
INFO:tensorflow:Evaluating checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\contrib\training\python\training\evaluation.py:298: SummaryWriter.__init__ (from tensorflow.python.training.summary_io) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.FileWriter. The interface and behavior is the same; this is just a rename.
INFO:tensorflow:Starting evaluation at 2017-03-21-16:28:30
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1022, in _do_call
return fn(*args)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1004, in _run_fn
status, run_metadata)
File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 66, in __exit__
next(self.gen)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
[[Node: save/RestoreV2_18 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_18/tensor_names, save/RestoreV2_18/shape_and_slices)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "eval_ssd_network.py", line 346, in <module>
tf.app.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "eval_ssd_network.py", line 320, in main
session_config=config)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\contrib\slim\python\slim\evaluation.py", line 207, in evaluate_once
config=session_config)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\contrib\training\python\training\evaluation.py", line 427, in evaluate_once
session_creator=session_creator, hooks=hooks) as session:
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\monitored_session.py", line 601, in __init__
session_creator, hooks, should_recover=True)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\monitored_session.py", line 434, in __init__
self._sess = _RecoverableSession(self._coordinated_creator)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\monitored_session.py", line 767, in __init__
_WrappedSession.__init__(self, self._create_session())
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\monitored_session.py", line 772, in _create_session
return self._sess_creator.create_session()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\monitored_session.py", line 494, in create_session
self.tf_sess = self._session_creator.create_session()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\monitored_session.py", line 375, in create_session
init_fn=self._scaffold.init_fn)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\session_manager.py", line 256, in prepare_session
config=config)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\session_manager.py", line 172, in _restore_checkpoint
saver.restore(sess, checkpoint_filename_with_path)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1428, in restore
{self.saver_def.filename_tensor_name: save_path})
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 767, in run
run_metadata_ptr)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 965, in _run
feed_dict_string, options, run_metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1015, in _do_run
target_list, options, run_metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1035, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
[[Node: save/RestoreV2_18 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_18/tensor_names, save/RestoreV2_18/shape_and_slices)]]
Caused by op 'save/RestoreV2_18', defined at:
File "eval_ssd_network.py", line 346, in <module>
tf.app.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "eval_ssd_network.py", line 320, in main
session_config=config)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\contrib\slim\python\slim\evaluation.py", line 195, in evaluate_once
saver = tf_saver.Saver(variables_to_restore)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1040, in __init__
self.build()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1070, in build
restore_sequentially=self._restore_sequentially)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 675, in build
restore_sequentially, reshape)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 402, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 242, in restore_op
[spec.tensor.dtype])[0])
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 668, in restore_v2
dtypes=dtypes, name=name)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 763, in apply_op
op_def=op_def)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2327, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1226, in __init__
self._traceback = _extract_stack()
I'm using Tensorflow 1.0.1
I am running the train_ssd_network.py code as it is and it only uses one GPU from the 8 GPUs that I have. Can u tell me how to scale it?
Do we have a way to test/demo video detection for the SSD net?
Hi,
the working code;
EVAL_DIR=./logs/
CHECKPOINT_PATH=./checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
python eval_ssd_network.py
--eval_dir=${EVAL_DIR}
--dataset_dir=${DATASET_DIR}
--dataset_name=pascalvoc_2007
--dataset_split_name=test
--model_name=ssd_300_vgg
--checkpoint_path=${CHECKPOINT_PATH}
--batch_size=1
When it is worked , it give the error that is;
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
['/home/eud/busra_face/SSD-Tensorflow-master/tfrecords/voc_2007_test.tfrecord']
Traceback (most recent call last):
File "eval_ssd_network.py", line 346, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "eval_ssd_network.py", line 190, in main
b_gclasses, b_glocalisations, b_gscores)
File "/home/eud/busra_face/SSD-Tensorflow-master/nets/ssd_vgg_300.py", line 248, in losses
scope=scope)
File "/home/eud/busra_face/SSD-Tensorflow-master/nets/ssd_vgg_300.py", line 639, in ssd_losses
loss = tf.losses.compute_weighted_loss(loss, fpmask)
AttributeError: 'module' object has no attribute 'losses'
i couldn't find any solution. Can you help me?
Hey :),
as far as I can see is there an error in building the tfrecords file ?
In pascalvoc_to_tfrecords.py in line 111-115 you have
bboxes.append((float(bbox.find('ymin').text) / shape[0],
float(bbox.find('xmin').text) / shape[1],
float(bbox.find('ymax').text) / shape[0],
float(bbox.find('xmax').text) / shape[1]
))
while in line 141 you get the xmin as the first value in [l.append(point) for l, point in zip([xmin, ymin, xmax, ymax], b)].
That should be switched, shouldn't it ?
[l.append(point) for l, point in zip([ymin, xmin, ymax, xmax], b)]
and then also in pascalvoc_common.py in line 94 it should be
['ymin', 'xmin', 'ymax', 'xmax'], 'image/object/bbox/'),
.
Would be happy about some feedback =).
Is the checkpoint data saved with GPU? I have a 13" MacBook Pro that doesn't have an Nvidia chip. How do I change this to use CPU instead of GPU?
hi:
the loss function is dived by N in ssd paper, where N is the number of matched default boxes.But i can not find this division operation in your code.Can you help me to figure it out please?
Hi @balancap nice job thanks for releasing this implementation.
What you think about changing the base networks implementation to use the new tf.layers VGG
I'm learn this watching the videos from the tensorflow summit
https://youtu.be/t64ortpgS-E?t=433
I only get 60 mAP on VGG model which should be 0.778 in the ReadME. The vgg model is download from here. My Evaluation command is like following:
python eval_ssd_network.py --eval_dir=./datatmp/ --dataset_dir=./datatmp/voc07_test.tfrecord --dateset_name=\
voc07 --model_name=ssd_300_vgg --checkpoint_path=./datatmp/VGG_VOC0712_SSD_300x300_iter_120000.ckpt --dataset_name=pascalvoc_2007
Did I do something wrong?
I have an error that 'matplotlib.cm object' don't find the 'plasma' attribute on the line below.
What's the problem?
What should I fix?
from nets import ssd_vgg_300, ssd_common, np_methods
from preprocessing import ssd_vgg_preprocessing
from notebooks import visualization
AttributeError Traceback (most recent call last)
in ()
1 from nets import ssd_vgg_300, ssd_common, np_methods
2 from preprocessing import ssd_vgg_preprocessing
----> 3 from notebooks import visualization
/home/nwkim/tensorflow-sample/SSD-Tensorflow/notebooks/visualization.py in ()
35 return sub_colors
36
---> 37 colors_plasma = colors_subselect(mpcm.plasma.colors, num_classes=21)
38 colors_tableau = [(255, 255, 255), (31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120),
39 (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 150),
AttributeError: 'module' object has no attribute 'plasma'
We have run your eval_ssd_network.py in Command.md and successfully get a eval/precision score. We want to run a single image detection and get a new image just like ex1.png. Could you help us to run it ? Your ssd_tests.ipynb in notebook is not very clear for this purpose. Thanks.
'tf_convert_data.py' make only 'voc_2007.train.tfrecord' file in ./tfrecords.
how can I make this 'voc_2007_test.tfrecord'?
$ sudo python eval_ssd_network.py --eval_dir=${EVAL_DIR} --dataset_dir=${DATASET_DIR} --dataset_name=pascalvoc_2007 --dataset_split_name=test --model_name=ssd_300_vgg --checkpoint_path=${CHECKPOINT_PATH} --batch_size=1
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.6 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
{'batch_size': 1,
'checkpoint_path': './checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt',
'dataset_dir': './VOC2007/',
'dataset_name': 'pascalvoc_2007',
'dataset_split_name': 'test',
'eval_dir': './logs/',
'eval_image_size': None,
'eval_resize': 4,
'gpu_memory_fraction': 0.04,
'keep_top_k': 200,
'master': '',
'matching_threshold': 0.5,
'max_num_batches': None,
'model_name': 'ssd_300_vgg',
'moving_average_decay': None,
'nms_threshold': 0.45,
'num_classes': 21,
'num_preprocessing_threads': 4,
'preprocessing_name': None,
'remove_difficult': True,
'select_threshold': 0.01,
'select_top_k': 400,
'wait_for_checkpoints': False}
{'anchor_offset': 0.5,
'anchor_ratios': [[2, 0.5],
[2, 0.5, 3, 0.3333333333333333],
[2, 0.5, 3, 0.3333333333333333],
[2, 0.5, 3, 0.3333333333333333],
[2, 0.5],
[2, 0.5]],
'anchor_size_bounds': [0.15, 0.9],
'anchor_sizes': [(21.0, 45.0),
(45.0, 99.0),
(99.0, 153.0),
(153.0, 207.0),
(207.0, 261.0),
(261.0, 315.0)],
'anchor_steps': [8, 16, 32, 64, 100, 300],
'feat_layers': ['block4', 'block7', 'block8', 'block9', 'block10', 'block11'],
'feat_shapes': [(38, 38), (19, 19), (10, 10), (5, 5), (3, 3), (1, 1)],
'img_shape': (300, 300),
'no_annotation_label': 21,
'normalizations': [20, -1, -1, -1, -1, -1],
'num_classes': 21,
'prior_scaling': [0.1, 0.1, 0.2, 0.2]}
['./VOC2007/voc_2007_test.tfrecord']
INFO:tensorflow:Evaluating ./checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckpt
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/training/python/training/evaluation.py:298: init (from tensorflow.python.training.summary_io) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.FileWriter. The interface and behavior is the same; this is just a rename.
INFO:tensorflow:Starting evaluation at 2017-03-30-08:37:50
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties:
name: TITAN X (Pascal)
major: 6 minor: 1 memoryClockRate (GHz) 1.531
pciBusID 0000:01:00.0
Total memory: 11.90GiB
Free memory: 3.24GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: TITAN X (Pascal), pci bus id: 0000:01:00.0)
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.NotFoundError'>, ./VOC2007/voc_2007_test.tfrecord
[[Node: pascalvoc_2007_data_provider/parallel_read/ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/cpu:0"](pascalvoc_2007_data_provider/parallel_read/TFRecordReaderV2, pascalvoc_2007_data_provider/parallel_read/filenames)]]
Caused by op u'pascalvoc_2007_data_provider/parallel_read/ReaderReadV2', defined at:
File "eval_ssd_network.py", line 350, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "eval_ssd_network.py", line 150, in main
shuffle=False)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/data/dataset_data_provider.py", line 83, in init
seed=seed)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/data/parallel_reader.py", line 234, in parallel_read
reader_kwargs=reader_kwargs).read(filename_queue)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/data/parallel_reader.py", line 132, in read
enqueue_ops.append(self._common_queue.enqueue(reader.read(queue)))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/io_ops.py", line 191, in read
return gen_io_ops._reader_read_v2(self._reader_ref, queue_ref, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 410, in _reader_read_v2
queue_handle=queue_handle, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2327, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1226, in init
self._traceback = _extract_stack()
NotFoundError (see above for traceback): ./VOC2007/voc_2007_test.tfrecord
[[Node: pascalvoc_2007_data_provider/parallel_read/ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/cpu:0"](pascalvoc_2007_data_provider/parallel_read/TFRecordReaderV2, pascalvoc_2007_data_provider/parallel_read/filenames)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
W tensorflow/core/framework/op_kernel.cc:993] Out of range: PaddingFIFOQueue '_2_batch/padding_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_FLOAT, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_INT64, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/padding_fifo_queue, batch/n)]]
I tensorflow/core/kernels/logging_ops.cc:79] AP_VOC07/mAP[0]
I tensorflow/core/kernels/logging_ops.cc:79] AP_VOC12/mAP[0]
Traceback (most recent call last):
File "eval_ssd_network.py", line 350, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "eval_ssd_network.py", line 324, in main
session_config=config)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/evaluation.py", line 207, in evaluate_once
config=session_config)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/training/python/training/evaluation.py", line 430, in evaluate_once
session.run(eval_ops, feed_dict)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 478, in exit
self._close_internal(exception_type)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 511, in _close_internal
self._sess.close()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 739, in close
self._sess.close()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 827, in close
self._coord.join()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/coordinator.py", line 386, in join
six.reraise(*self._exc_info_to_raise)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 234, in _run
sess.run(enqueue_op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 767, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1015, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1035, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: ./VOC2007/voc_2007_test.tfrecord
[[Node: pascalvoc_2007_data_provider/parallel_read/ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/cpu:0"](pascalvoc_2007_data_provider/parallel_read/TFRecordReaderV2, pascalvoc_2007_data_provider/parallel_read/filenames)]]
Caused by op u'pascalvoc_2007_data_provider/parallel_read/ReaderReadV2', defined at:
File "eval_ssd_network.py", line 350, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "eval_ssd_network.py", line 150, in main
shuffle=False)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/data/dataset_data_provider.py", line 83, in init
seed=seed)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/data/parallel_reader.py", line 234, in parallel_read
reader_kwargs=reader_kwargs).read(filename_queue)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/data/parallel_reader.py", line 132, in read
enqueue_ops.append(self._common_queue.enqueue(reader.read(queue)))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/io_ops.py", line 191, in read
return gen_io_ops._reader_read_v2(self._reader_ref, queue_ref, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 410, in _reader_read_v2
queue_handle=queue_handle, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2327, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1226, in init
self._traceback = _extract_stack()
NotFoundError (see above for traceback): ./VOC2007/voc_2007_test.tfrecord
[[Node: pascalvoc_2007_data_provider/parallel_read/ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/cpu:0"](pascalvoc_2007_data_provider/parallel_read/TFRecordReaderV2, pascalvoc_2007_data_provider/parallel_read/filenames)]]
in def tf_ssd_bboxes_encode_layer()
yref, xref, href, wref = anchors_layer
anchors_layer should be a list includes anchor boxes( (y,x,h,w) ) of each layer, the len(achors_layer) should be 6(6 feature maps)
So, how this assignment can work?
yref, xref, href, wref = anchors_layer
oh , I find out the problem
:)
I have downloaded vgg_16.ckpt from download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
and unzip it on the folder "./checkpoints"
DATASET_DIR=./tfrecords
TRAIN_DIR=./logs/
CHECKPOINT_PATH=./checkpoints/vgg_16.ckpt
python train_ssd_network.py \
--train_dir=${TRAIN_DIR} \
--dataset_dir=${DATASET_DIR} \
--dataset_name=pascalvoc_2007 \
--dataset_split_name=train \
--model_name=ssd_300_vgg \
--checkpoint_path=${CHECKPOINT_PATH} \
--checkpoint_exclude_scopes=ssd_300_vgg/block4_box,ssd_300_vgg/block7_box,ssd_300_vgg/block8_box,ssd_300_vgg/block9_box,ssd_300_vgg/block10_box,ssd_300_vgg/block11_box \
--save_summaries_secs=60 \
--save_interval_secs=600 \
--weight_decay=0.00001 \
--optimizer=rmsprop \
--learning_rate=0.0001 \
--batch_size=32
NotFoundError (see above for traceback): Tensor name "ssd_300_vgg/block10/conv1x1/biases" not found in checkpoint files ./checkpoints/vgg_16.ckpt
emmmm..... How to solve this problem? T_T
Thank you!:)
I hava followed the instructions of readme.md, running the following command:
DATASET_DIR=./tfrecords
TRAIN_DIR=./logs/
CHECKPOINT_PATH=./checkpoints/vgg_16.ckpt
python train_ssd_network.py
--train_dir=${TRAIN_DIR}
--dataset_dir=${DATASET_DIR}
--dataset_name=pascalvoc_2007
--dataset_split_name=train
--model_name=ssd_300_vgg
--checkpoint_path=${CHECKPOINT_PATH}
--checkpoint_model_scope=vgg_16
--checkpoint_exclude_scopes=ssd_300_vgg/conv6,ssd_300_vgg/conv7,ssd_300_vgg/block8,ssd_300_vgg/block9,ssd_300_vgg/block10,ssd_300_vgg/block11,ssd_300_vgg/block4_box,ssd_300_vgg/block7_box,ssd_300_vgg/block8_box,ssd_300_vgg/block9_box,ssd_300_vgg/block10_box,ssd_300_vgg/block11_box
--save_summaries_secs=60
--save_interval_secs=600
--weight_decay=0.0005
--optimizer=rmsprop
--learning_rate=0.0001
--batch_size=32
I got the error: InvalidArgumentError (see above for traceback): All bounding box coordinates must be in [0.0, 1.0]: -0.0048828125.
What I see in the console output as follows:
['/home/wahaha/documents/haha/FaceDetection/traindata-tf/voc_2007_train.tfrecord']
INFO:tensorflow:Fine-tuning from /home/wahaha/documents/haha/FaceDetection/checkpoints/vgg_16.ckpt
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties:
name: GeForce GTX 1070
major: 6 minor: 1 memoryClockRate (GHz) 1.835
pciBusID 0000:01:00.0
Total memory: 7.92GiB
Free memory: 7.50GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0)
INFO:tensorflow:Starting Session.
INFO:tensorflow:Starting Queues.
INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, All bounding box coordinates must be in [0.0, 1.0]: -0.0048828125
[[Node: ssd_preprocessing_train/distorted_bounding_box_crop/SampleDistortedBoundingBox = SampleDistortedBoundingBox[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.8, 1.2], max_attempts=200, min_object_covered=0.05, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/cpu:0"](ssd_preprocessing_train/distorted_bounding_box_crop/Shape, ssd_preprocessing_train/distorted_bounding_box_crop/ExpandDims)]]
Caused by op u'ssd_preprocessing_train/distorted_bounding_box_crop/SampleDistortedBoundingBox', defined at:
File "train_ssd_network.py", line 385, in
tf.app.run()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train_ssd_network.py", line 235, in main
image_preprocessing_fn(image, glabels, gbboxes, ssd_shape)
File "/home/wahaha/documents/haha/FaceDetection/preprocessing/preprocessing_factory.py", line 59, in preprocessing_fn
is_training=is_training, **kwargs)
File "/home/wahaha/documents/haha/FaceDetection/preprocessing/ssd_vgg_preprocessing.py", line 395, in preprocess_image
data_format=data_format)
File "/home/wahaha/documents/haha/FaceDetection/preprocessing/ssd_vgg_preprocessing.py", line 270, in preprocess_for_train
aspect_ratio_range=CROP_RATIO_RANGE)
File "/home/wahaha/documents/haha/FaceDetection/preprocessing/ssd_vgg_preprocessing.py", line 217, in distorted_bounding_box_crop
use_image_if_no_bounding_boxes=True)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_image_ops.py", line 989, in sample_distorted_bounding_box
name=name)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2395, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1264, in init
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): All bounding box coordinates must be in [0.0, 1.0]: -0.0048828125
[[Node: ssd_preprocessing_train/distorted_bounding_box_crop/SampleDistortedBoundingBox = SampleDistortedBoundingBox[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.8, 1.2], max_attempts=200, min_object_covered=0.05, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/cpu:0"](ssd_preprocessing_train/distorted_bounding_box_crop/Shape, ssd_preprocessing_train/distorted_bounding_box_crop/ExpandDims)]]
Traceback (most recent call last):
File "train_ssd_network.py", line 385, in
tf.app.run()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train_ssd_network.py", line 381, in main
sync_optimizer=None)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 804, in train
raise
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/supervisor.py", line 973, in managed_session
self.stop(close_summary_writer=close_summary_writer)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/supervisor.py", line 801, in stop
stop_grace_period_secs=self._stop_grace_secs)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/coordinator.py", line 386, in join
six.reraise(*self._exc_info_to_raise)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/queue_runner_impl.py", line 234, in _run
sess.run(enqueue_op)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 767, in run
run_metadata_ptr)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 965, in _run
feed_dict_string, options, run_metadata)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1015, in _do_run
target_list, options, run_metadata)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1035, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: All bounding box coordinates must be in [0.0, 1.0]: -0.0048828125
[[Node: ssd_preprocessing_train/distorted_bounding_box_crop/SampleDistortedBoundingBox = SampleDistortedBoundingBox[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.8, 1.2], max_attempts=200, min_object_covered=0.05, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/cpu:0"](ssd_preprocessing_train/distorted_bounding_box_crop/Shape, ssd_preprocessing_train/distorted_bounding_box_crop/ExpandDims)]]
Caused by op u'ssd_preprocessing_train/distorted_bounding_box_crop/SampleDistortedBoundingBox', defined at:
File "train_ssd_network.py", line 385, in
tf.app.run()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train_ssd_network.py", line 235, in main
image_preprocessing_fn(image, glabels, gbboxes, ssd_shape)
File "/home/wahaha/documents/haha/FaceDetection/preprocessing/preprocessing_factory.py", line 59, in preprocessing_fn
is_training=is_training, **kwargs)
File "/home/wahaha/documents/haha/FaceDetection/preprocessing/ssd_vgg_preprocessing.py", line 395, in preprocess_image
data_format=data_format)
File "/home/wahaha/documents/haha/FaceDetection/preprocessing/ssd_vgg_preprocessing.py", line 270, in preprocess_for_train
aspect_ratio_range=CROP_RATIO_RANGE)
File "/home/wahaha/documents/haha/FaceDetection/preprocessing/ssd_vgg_preprocessing.py", line 217, in distorted_bounding_box_crop
use_image_if_no_bounding_boxes=True)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_image_ops.py", line 989, in sample_distorted_bounding_box
name=name)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2395, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1264, in init
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): All bounding box coordinates must be in [0.0, 1.0]: -0.0048828125
[[Node: ssd_preprocessing_train/distorted_bounding_box_crop/SampleDistortedBoundingBox = SampleDistortedBoundingBox[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.8, 1.2], max_attempts=200, min_object_covered=0.05, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/cpu:0"](ssd_preprocessing_train/distorted_bounding_box_crop/Shape, ssd_preprocessing_train/distorted_bounding_box_crop/ExpandDims)]]
How to fix that issue? Thanks!
My result is very bad. The mAP is close to 0. I don't know why, hope anyone who can help me ! Thanks!!!!
hello, would it be easy to add batch normalization to this model?
TypeError Traceback (most recent call last)
in ()
11 reuse = True if 'ssd_net' in locals() else None
12 ssd_net = ssd_vgg_300.SSDNet()
---> 13 with slim.arg_scope(ssd_net.arg_scope(data_format=data_format)):
14 predictions, localisations, _, _ = ssd_net.net(image_4d, is_training=False, reuse=reuse)
15
C:\Users\kangd345\Desktop\New folder (3)\SSD-Tensorflow-master\nets\ssd_vgg_300.py in arg_scope(self, weight_decay, data_format)
163 """Network arg_scope.
164 """
--> 165 return ssd_arg_scope(weight_decay, data_format=data_format)
166
167 def arg_scope_caffe(self, caffe_scope):
C:\Users\kangd345\Desktop\New folder (3)\SSD-Tensorflow-master\nets\ssd_vgg_300.py in ssd_arg_scope(weight_decay, data_format)
534 weights_regularizer=slim.l2_regularizer(weight_decay),
535 weights_initializer=tf.contrib.layers.xavier_initializer(),
--> 536 biases_initializer=tf.zeros_initializer()):
537 with slim.arg_scope([slim.conv2d, slim.max_pool2d],
538 padding='SAME',
TypeError: zeros_initializer() missing 1 required positional argument: 'shape'
Hey Paul, I have been trying to complete my port of SSD to PyTorch and have come across your repo multiple times along the way.
Currently, without using all of the data augmentation, my model appears to be getting to a loss of around 0.05 at only 20k iterations on VOC07trainval (purely training without any validation along the way). Did you ever run into this, or is this normal to your knowledge? (I haven't implemented mAP yet so that's next on my list).
Second, your example detections look incredible. Is the car one on the README using COCO weights? When I test on that image I only have been able to pick up a few of the cars with VOC07 weights. It could also be my NMS parameters I suppose..
Your work is extremely impressive, while you're further along than I am I can attest to the difficulty and time required to reimplementing this network :P!
---------------------------------------------------------------------------
InvalidArgumentError Traceback (most recent call last)
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
1021 try:
-> 1022 return fn(*args)
1023 except errors.OpError as e:
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata)
1003 feed_dict, fetch_list, target_list,
-> 1004 status, run_metadata)
1005
/usr/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
65 try:
---> 66 next(self.gen)
67 except StopIteration:
/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status()
468 compat.as_text(pywrap_tensorflow.TF_Message(status)),
--> 469 pywrap_tensorflow.TF_GetCode(status))
470 finally:
InvalidArgumentError: CPU BiasOp only supports NHWC.
[[Node: ssd_300_vgg/conv1/conv1_1/BiasAdd = BiasAdd[T=DT_FLOAT, data_format="NCHW", _device="/job:localhost/replica:0/task:0/cpu:0"](ssd_300_vgg/conv1/conv1_1/convolution, ssd_300_vgg/conv1/conv1_1/biases/read)]]
During handling of the above exception, another exception occurred:
InvalidArgumentError Traceback (most recent call last)
<ipython-input-8-9c23411992fd> in <module>()
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)
<ipython-input-7-38d1654ffec4> in process_image(img, select_threshold, nms_threshold, net_shape)
3 # Run SSD network.
4 rimg, rpredictions, rlocalisations, rbbox_img = isess.run([image_4d, predictions, localisations, bbox_img],
----> 5 feed_dict={img_input: img})
6
7 # Get classes and bboxes from the net outputs.
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
765 try:
766 result = self._run(None, fetches, feed_dict, options_ptr,
--> 767 run_metadata_ptr)
768 if run_metadata:
769 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
963 if final_fetches or final_targets:
964 results = self._do_run(handle, final_targets, final_fetches,
--> 965 feed_dict_string, options, run_metadata)
966 else:
967 results = []
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
1013 if handle is None:
1014 return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
-> 1015 target_list, options, run_metadata)
1016 else:
1017 return self._do_call(_prun_fn, self._session, handle, feed_dict,
/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
1033 except KeyError:
1034 pass
-> 1035 raise type(e)(node_def, op, message)
1036
1037 def _extend_graph(self):
InvalidArgumentError: CPU BiasOp only supports NHWC.
[[Node: ssd_300_vgg/conv1/conv1_1/BiasAdd = BiasAdd[T=DT_FLOAT, data_format="NCHW", _device="/job:localhost/replica:0/task:0/cpu:0"](ssd_300_vgg/conv1/conv1_1/convolution, ssd_300_vgg/conv1/conv1_1/biases/read)]]
Caused by op 'ssd_300_vgg/conv1/conv1_1/BiasAdd', defined at:
File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.5/dist-packages/ipykernel/__main__.py", line 3, in <module>
app.launch_new_instance()
File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py", line 653, in launch_instance
app.start()
File "/usr/local/lib/python3.5/dist-packages/ipykernel/kernelapp.py", line 474, in start
ioloop.IOLoop.instance().start()
File "/usr/lib/python3/dist-packages/zmq/eventloop/ioloop.py", line 162, in start
super(ZMQIOLoop, self).start()
File "/usr/lib/python3/dist-packages/tornado/ioloop.py", line 866, in start
handler_func(fd_obj, events)
File "/usr/lib/python3/dist-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events
self._handle_recv()
File "/usr/lib/python3/dist-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv
self._run_callback(callback, msg)
File "/usr/lib/python3/dist-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback
callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/ipykernel/kernelbase.py", line 276, in dispatcher
return self.dispatch_shell(stream, msg)
File "/usr/local/lib/python3.5/dist-packages/ipykernel/kernelbase.py", line 228, in dispatch_shell
handler(stream, idents, msg)
File "/usr/local/lib/python3.5/dist-packages/ipykernel/kernelbase.py", line 390, in execute_request
user_expressions, allow_stdin)
File "/usr/local/lib/python3.5/dist-packages/ipykernel/ipkernel.py", line 196, in do_execute
res = shell.run_cell(code, store_history=store_history, silent=silent)
File "/usr/local/lib/python3.5/dist-packages/ipykernel/zmqshell.py", line 501, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/IPython/core/interactiveshell.py", line 2717, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "/usr/local/lib/python3.5/dist-packages/IPython/core/interactiveshell.py", line 2821, in run_ast_nodes
if self.run_code(code, result):
File "/usr/local/lib/python3.5/dist-packages/IPython/core/interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-4f4296a3f120>", line 14, in <module>
predictions, localisations, _, _ = ssd_net.net(image_4d, is_training=False, reuse=reuse)
File "../nets/ssd_vgg_300.py", line 155, in net
scope=scope)
File "../nets/ssd_vgg_300.py", line 452, in ssd_net
net = slim.repeat(inputs, 2, slim.conv2d, 64, [3, 3], scope='conv1')
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1720, in repeat
outputs = layer(outputs, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 177, in func_with_args
return func(*args, **current_args)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/layers/python/layers/layers.py", line 907, in convolution
outputs = layer.apply(inputs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/layers/base.py", line 303, in apply
return self.__call__(inputs, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/layers/base.py", line 273, in __call__
outputs = self.call(inputs, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/layers/convolutional.py", line 169, in call
data_format=utils.convert_data_format(self.data_format, 4))
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/nn_ops.py", line 1316, in bias_add
return gen_nn_ops._bias_add(value, bias, data_format=data_format, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 281, in _bias_add
data_format=data_format, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 2395, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1264, in __init__
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): CPU BiasOp only supports NHWC.
[[Node: ssd_300_vgg/conv1/conv1_1/BiasAdd = BiasAdd[T=DT_FLOAT, data_format="NCHW", _device="/job:localhost/replica:0/task:0/cpu:0"](ssd_300_vgg/conv1/conv1_1/convolution, ssd_300_vgg/conv1/conv1_1/biases/read)]]
I have such a problem while just testing ssd_notebook. How to fix that issue?
codes of function "tf_ssd_bboxes_encode_layer"
feat_ymin = tf.zeros(shape, dtype=dtype)
feat_xmin = tf.zeros(shape, dtype=dtype)
feat_ymax = tf.ones(shape, dtype=dtype)
feat_xmax = tf.ones(shape, dtype=dtype)
why fest_ymin is tf.zeros but the feat_ymax is tf.ones?
Hi,
When SSD-Tensorflow-master/notebooks/ssd_tests.ipynb is wroked ,i am taking error that is "ValueError: need more than 2 values to unpack". when I looked at the code of ssd_common.py, i saw that tf_ssd_bboxes_select has a two output. after that i saw tf_ssd_bboxes_select_all_classes. it has tree output and pass the error.
the code
nms_threshold = 0.5
localisations = ssd.bboxes_decode(localisations, layers_anchors)
tclasses, tscores, tbboxes = ssd_common.tf_ssd_bboxes_select(predictions, localisations)
tclasses, tscores, tbboxes = ssd_common.tf_bboxes_sort(tclasses, tscores, tbboxes, top_k=400)
tclasses, tscores, tbboxes = ssd_common.tf_bboxes_nms_batch(tclasses, tscores, tbboxes,
nms_threshold=0.3, num_classes=ssd.params.num_classes)
the eror;
ValueError Traceback (most recent call last)
in ()
3 # Output decoding.
4 localisations = ssd.bboxes_decode(localisations, layers_anchors)
----> 5 tclasses, tscores, tbboxes = ssd_common.tf_ssd_bboxes_select(predictions, localisations)
6 tclasses, tscores, tbboxes = ssd_common.tf_bboxes_sort(tclasses, tscores, tbboxes, top_k=400)
7 tclasses, tscores, tbboxes = ssd_common.tf_bboxes_nms_batch(tclasses, tscores, tbboxes,
ValueError: need more than 2 values to unpack
But i took error next line, that is ssd_common.tf_bboxes_sort. the error is "AttributeError: 'module' object has no attribute 'tf_bboxes_sort' " When i looked at ssd.common.py, i couldnt find tf_bboxes_sort function. so what i need to do? can u help me?
the code
nms_threshold = 0.5
localisations = ssd.bboxes_decode(localisations, layers_anchors)
tclasses, tscores, tbboxes = ssd_common.tf_ssd_bboxes_select_all_classes(predictions, localisations)
tclasses, tscores, tbboxes = ssd_common.tf_bboxes_sort(tclasses, tscores, tbboxes, top_k=400)
tclasses, tscores, tbboxes = ssd_common.tf_bboxes_nms_batch(tclasses, tscores, tbboxes,
nms_threshold=0.3, num_classes=ssd.params.num_classes)
the error
AttributeError Traceback (most recent call last)
in ()
4 localisations = ssd.bboxes_decode(localisations, layers_anchors)
5 tclasses, tscores, tbboxes = ssd_common.tf_ssd_bboxes_select_all_classes(predictions, localisations)
----> 6 tclasses, tscores, tbboxes = ssd_common.tf_bboxes_sort(tclasses, tscores, tbboxes, top_k=400)
7 tclasses, tscores, tbboxes = ssd_common.tf_bboxes_nms_batch(tclasses, tscores, tbboxes,
8 nms_threshold=0.3, num_classes=ssd.params.num_classes)
AttributeError: 'module' object has no attribute 'tf_bboxes_sort'
I have a problem when testing ssd_notebook. It seems that matplotlib.cm has no attribute 'plasma'.
It would be cool to have support for shuffling training data within each epoch. I mean on a behavior similar to:
string_input_producer has options for shuffling and setting a maximum number of epochs. A queue runner adds the whole list of filenames to the queue once for each epoch, shuffling the filenames within an epoch if shuffle=True. This procedure provides a uniform sampling of files, so that examples are not under- or over- sampled relative to each other.
It seems that this way every batch is sampled completely random from the set. Lets say I have images 1 2 3 4 in the training set and batch_size=2. With this code, when training, I can get batches:
1 2| 1 3| 1 4| 2 3
so in two epochs, net has seen example 1 three times, and 4 only one time.
Hello,
I am using Tensorflow Ver. 1.0.0
I am using Python 2.7
I have GPU Nvidia Quadro K4200
I tried to run the script exactly as the READ ME file says and it faild at the training section.
I tried to run this:
DATASET_DIR=./tfrecords
TRAIN_DIR=./logs/
CHECKPOINT_PATH=./checkpoints/ssd_300_vgg.ckpt
python train_ssd_network.py
--train_dir=${TRAIN_DIR}
--dataset_dir=${DATASET_DIR}
--dataset_name=pascalvoc_2012
--dataset_split_name=train
--model_name=ssd_300_vgg
--checkpoint_path=${CHECKPOINT_PATH}
--save_summaries_secs=60
--save_interval_secs=600
--weight_decay=0.0005
--optimizer=adam
--learning_rate=0.001
--batch_size=32
and it gives me an this error:
"tensorflow.python.framework.errors_impl.InternalError: Unable to get element from the feed as bytes."
If someone knows how to fix this error, I will be greatful.
In the function
def condition(i, feat_scores,
feat_ymin, feat_xmin, feat_ymax, feat_xmax):
"""Condition: check label index.
"""
r = tf.less(i, tf.shape(labels))
return r
of SSD_common
the shape of labels always be 1 rather than the num of labels, right?
So how can i get the number of labels?
The readme didn't mention the fps. Is it slower or faster than the original caffe inplementation?
Hi @balancap , with tensorflow 1.0 installed, I tried running the "Minimal example" codes posted in here https://github.com/balancap/SSD-Tensorflow. I had an "unexpected keyword argument 'partition_info'" error.
File "/home/levin/.p2/pool/plugins/org.python.pydev_5.4.0.201611281236/pysrc/pydevd.py", line 1537, in
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/levin/.p2/pool/plugins/org.python.pydev_5.4.0.201611281236/pysrc/pydevd.py", line 976, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/levin/.p2/pool/plugins/org.python.pydev_5.4.0.201611281236/pysrc/_pydev_imps/_pydev_execfile.py", line 25, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/levin/workspace/detection/SSD-Tensorflow/notebooks/ssd_demo.py", line 20, in
predictions, localisations, logits, end_points = ssd.net(image_4d, is_training=False)
File "/home/levin/workspace/detection/SDC-Vehicle-Detection/nets/ssd_vgg_300.py", line 128, in net
scope=scope)
File "/home/levin/workspace/detection/SDC-Vehicle-Detection/nets/ssd_vgg_300.py", line 394, in ssd_net
net = slim.repeat(inputs, 2, slim.conv2d, 64, [3, 3], scope='conv1')
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1720, in repeat
outputs = layer(outputs, *args, **kwargs)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 177, in func_with_args
return func(*args, **current_args)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 907, in convolution
outputs = layer.apply(inputs)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 303, in apply
return self.call(inputs, **kwargs)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 269, in call
self.build(input_shapes[0])
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/layers/convolutional.py", line 145, in build
dtype=self.dtype)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 988, in get_variable
custom_getter=custom_getter)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 890, in get_variable
custom_getter=custom_getter)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 341, in get_variable
validate_shape=validate_shape)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 258, in variable_getter
variable_getter=functools.partial(getter, **kwargs))
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 208, in _add_variable
trainable=trainable and self.trainable)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1310, in layer_variable_getter
return _model_variable_getter(getter, *args, **kwargs)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1299, in _model_variable_getter
custom_getter=getter)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 177, in func_with_args
return func(*args, **current_args)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 268, in model_variable
partitioner=partitioner, custom_getter=custom_getter)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 177, in func_with_args
return func(*args, **current_args)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 225, in variable
partitioner=partitioner)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 333, in _true_getter
caching_device=caching_device, validate_shape=validate_shape)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 684, in _get_single_variable
validate_shape=validate_shape)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/variables.py", line 226, in init
expected_shape=expected_shape)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/variables.py", line 303, in _init_from_args
initial_value(), name="initial_value", dtype=dtype)
File "/home/levin/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 673, in
shape.as_list(), dtype=dtype, partition_info=partition_info)
TypeError: init() got an unexpected keyword argument 'partition_info'
Sorry to interrupt you, I simply can't find the api of tf.slim, some functions are not easy to understand how to use and I want to how to find the slim's api.
Hi @balancap, Can you tell me which version of ternsorflow you are using with this project? Thanks.
I tried running train_ssd_network with tensorflow 0.11, and encountered below problem.
AttributeError: module 'tensorflow.python.summary.summary' has no attribute 'image'
Tried to convert an existing ssd_512_vgg caffemodel file, got following error:
"Traceback (most recent call last):
File "caffe_to_tensorflow.py", line 64, in
tf.app.run()
File "/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "caffe_to_tensorflow.py", line 50, in main
ssd_net.net(img_input, is_training=False)
File "/home/dsu/ai/stf/nets/ssd_vgg_512.py", line 132, in net
scope=scope)
File "/home/dsu/ai/stf/nets/ssd_vgg_512.py", line 452, in ssd_net
normalizations[i])
File "/home/dsu/ai/stf/nets/ssd_vgg_300.py", line 419, in ssd_multibox_layer
tensor_shape(cls_pred, 4)[:-1]+[num_anchors, num_classes])
File "/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 2630, in reshape
name=name)
File "/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2397, in create_op
set_shapes_for_outputs(ret)
File "/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1757, in set_shapes_for_outputs
shapes = shape_func(op)
File "/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1707, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File "/home/dsu/tf/local/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 675, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Cannot reshape a tensor with 229376 elements to shape [1,64,64,4,21] (344064 elements) for 'ssd_512_vgg/block4_box/Reshape_1' (op: 'Reshape') with input shapes: [1,64,64,56], [5]."
Command line is: "python caffe_to_tensorflow.py --model_name=ssd_512_vgg --num_classes=14 --caffemodel_path=${CAFFE_MODEL}"
Env: ubuntu 16.04.1, tensorflow 1.0.
Hi,
First of all, Thanks for your excellent implementation !
I already made VOC2007 TFRecord files.
Then, I have a question how to make VOC 07+12 TFRecord that is union of 2007 and 2012.
In pascalvoc_2007.py, there is a function named get split,but I dont know how to use it to split the dataset. thanks.
Hello,
I am interested in loading one of the checkpoints you've made into an application that only takes Tensorflow frozen graphs (.pb
file).
I'm using the freeze_graph.py
tool to do so. I've generated the input_graph
by running tf.train.write_graph(session.graph_def, '/home/mjohnst/graph.pbtxt')
during the caffe_to_tensorflow.py
script that generates the checkpoint.
One additional parameter I need is the output_node_names
. I got all the node names by running tf.get_default_graph().as_graph_def().node
and choose the last node in the list save/restore_all
Is this the correct name of the output nodes?
If I'm going about this wrong, feel free to correct me :)
I was thinking that my call to write_graph
may be able to write out the whole frozen graph, but I'm not sure. In the write_graph
I tried using as_text=False
and changed the format to pb
, but when trying to freeze the weights into the input graph (assuming I still need to do this), I get an exception.
Thanks!
Hi,
I used the VOC2007 example, and I got an average test time of 0.2 sec per image, while using the original Caffe code on the same computer took 0.016 sec per image. Both test were on VGG architecture.
Another difference I've found was that the TF implementation takes much more memory. I could use tests on batch of size <=2. Otherwise my server ran out of memory. While on Caffe I could use bigger batches.
The time tests were made using the eval_ssd_network.py file.
Thanks
Hi, thanks for your work to implement SSD on TensorFlow。It’s very helpful for me!
But now I met some mistakes。when I use my own dataset to try this step, I got error as below:
I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0)
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.NotFoundError'>, Tensor name "ssd_300_vgg/block10/conv1x1/weights" not found in checkpoint files ./checkpoints/vgg_16.ckpt
[[Node: save_1/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save_1/Const_0, save_1/RestoreV2_1/tensor_names, save_1/RestoreV2_1/shape_and_slices)]]
Caused by op u'save_1/RestoreV2_1', defined at:
File "train_ssd_network.py", line 363, in
tf.app.run()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train_ssd_network.py", line 351, in main
init_fn=tf_utils.get_init_fn(FLAGS),
File "/home/wahaha/documents/haha/SSD-Tensorflow-master/tf_utils.py", line 225, in get_init_fn
ignore_missing_vars=flags.ignore_missing_vars)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 584, in assign_from_checkpoint_fn
saver = tf_saver.Saver(var_list, reshape=reshape_variables)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1051, in init
self.build()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1081, in build
restore_sequentially=self._restore_sequentially)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 675, in build
restore_sequentially, reshape)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 402, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 242, in restore_op
[spec.tensor.dtype])[0])
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_io_ops.py", line 668, in restore_v2
dtypes=dtypes, name=name)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2395, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1264, in init
self._traceback = _extract_stack()
NotFoundError (see above for traceback): Tensor name "ssd_300_vgg/block10/conv1x1/weights" not found in checkpoint files ./checkpoints/vgg_16.ckpt
[[Node: save_1/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save_1/Const_0, save_1/RestoreV2_1/tensor_names, save_1/RestoreV2_1/shape_and_slices)]]
Traceback (most recent call last):
File "train_ssd_network.py", line 363, in
tf.app.run()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train_ssd_network.py", line 359, in main
session_config=config)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/contrib/slim/python/slim/learning.py", line 776, in train
master, start_standard_services=False, config=session_config) as sess:
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/supervisor.py", line 973, in managed_session
self.stop(close_summary_writer=close_summary_writer)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/supervisor.py", line 801, in stop
stop_grace_period_secs=self._stop_grace_secs)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/coordinator.py", line 386, in join
six.reraise(*self._exc_info_to_raise)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/supervisor.py", line 962, in managed_session
start_standard_services=start_standard_services)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/supervisor.py", line 719, in prepare_or_wait_for_session
init_feed_dict=self._init_feed_dict, init_fn=self._init_fn)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/session_manager.py", line 264, in prepare_session
init_fn(sess)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 586, in callback
saver.restore(session, model_path)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1439, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 767, in run
run_metadata_ptr)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 965, in _run
feed_dict_string, options, run_metadata)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1015, in _do_run
target_list, options, run_metadata)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1035, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Tensor name "ssd_300_vgg/block10/conv1x1/weights" not found in checkpoint files ./checkpoints/vgg_16.ckpt
[[Node: save_1/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save_1/Const_0, save_1/RestoreV2_1/tensor_names, save_1/RestoreV2_1/shape_and_slices)]]
Caused by op u'save_1/RestoreV2_1', defined at:
File "train_ssd_network.py", line 363, in
tf.app.run()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train_ssd_network.py", line 351, in main
init_fn=tf_utils.get_init_fn(FLAGS),
File "/home/wahaha/documents/haha/SSD-Tensorflow-master/tf_utils.py", line 225, in get_init_fn
ignore_missing_vars=flags.ignore_missing_vars)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 584, in assign_from_checkpoint_fn
saver = tf_saver.Saver(var_list, reshape=reshape_variables)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1051, in init
self.build()
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1081, in build
restore_sequentially=self._restore_sequentially)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 675, in build
restore_sequentially, reshape)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 402, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 242, in restore_op
[spec.tensor.dtype])[0])
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_io_ops.py", line 668, in restore_v2
dtypes=dtypes, name=name)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2395, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/wahaha/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1264, in init
self._traceback = _extract_stack()
NotFoundError (see above for traceback): Tensor name "ssd_300_vgg/block10/conv1x1/weights" not found in checkpoint files ./checkpoints/vgg_16.ckpt
[[Node: save_1/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save_1/Const_0, save_1/RestoreV2_1/tensor_names, save_1/RestoreV2_1/shape_and_slices)]]
I don‘t know why。If you know,can you tell me。Thanks !!
DATASET_DIR=./tfrecords
TRAIN_DIR=./logs/
CHECKPOINT_PATH=./checkpoints/ssd_300_vgg.ckpt
python3 train_ssd_network.py
--train_dir=${TRAIN_DIR}
--dataset_dir=${DATASET_DIR}
--dataset_name=wider
--dataset_split_name=train
--model_name=ssd_300_vgg
--checkpoint_path=${CHECKPOINT_PATH}
--save_summaries_secs=60
--save_interval_secs=600
--weight_decay=0.0005
--optimizer=rmsprop
--learning_rate=0.001
--num_classes=2
--batch_size=16
--checkpoint_model_scope=ssd_300_vgg
--checkpoint_exclude_scopes=ssd_300_vgg/block4_box/conv_cls, ssd_300_vgg/block11_box/conv_cls, ssd_300_vgg/block10_box/conv_cls
InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 84 values, but the requested shape has 8
[[Node: save/Reshape_15 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](save/RestoreV2_15, save/Reshape_15/shape)]]
in SSDNet():
anchor_sizes=[(21., 45.),
(45., 99.),
(99., 153.),
(153., 207.),
(207., 261.),
(261., 315.)]
what is anchor_sizes mean? Can not find something related to this in paper.
I think this must have some relations with the scale (Sk) in paper. What's the relationship?
thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.