Giter VIP home page Giter VIP logo

mxnet-ssd's Introduction

SSD: Single Shot MultiBox Object Detector

SSD is an unified framework for object detection with a single network.

You can use the code to train/evaluate/test for object detection task.

Disclaimer

This is a re-implementation of original SSD which is based on caffe. The official repository is available here. The arXiv paper is available here.

This example is intended for reproducing the nice detector while fully utilize the remarkable traits of MXNet.

  • The model is fully compatible with caffe version.
  • Model converter from caffe is available now!
  • The result is almost identical to the original version. However, due to different implementation details, the results might differ slightly.

What's new

  • This repo is now deprecated, I am migrating to the latest Gluon-CV which is more user friendly and has a lot more algorithms in development. This repo will not receive active development, however, you can continue use it with the mxnet 1.1.0(probably 1.2.0).
  • Now this repo is internally synchronized up to data with offical mxnet backend. pip install mxnet will work for this repo as well in most cases.
  • MobileNet pretrained model now provided.
  • Added multiple trained models.
  • Added a much simpler way to compose network from mainstream classification networks (resnet, inception...) and Guide.
  • Update to the latest version according to caffe version, with 5% mAP increase.
  • Use C++ record iterator based on back-end multi-thread engine to achieve huge speed up on multi-gpu environments.
  • Monitor validation mAP during training.
  • More network symbols under development and test.
  • Extra operators are now in mxnet/src/operator/contrib, symbols are modified. Please use Release-v0.2-beta for old models.
  • added Docker support for this repository, prebuilt & including all packages and dependencies. (linux only)
  • added tensorboard support, allowing a more convenient way of research. (linux only)

Demo results

demo1 demo2 demo3

mAP

Model Training data Test data mAP Note
VGG16_reduced 300x300 VOC07+12 trainval VOC07 test 77.8 fast
VGG16_reduced 512x512 VOC07+12 trainval VOC07 test 79.9 slow
Inception-v3 512x512 VOC07+12 trainval VOC07 test 78.9 fastest
Resnet-50 512x512 VOC07+12 trainval VOC07 test 79.1 fast
MobileNet 512x512 VOC07+12 trainval VOC07 test 72.5 super fast
MobileNet 608x608 VOC07+12 trainval VOC07 test 74.7 super fast

More to be added

Speed

Model GPU CUDNN Batch-size FPS*
VGG16_reduced 300x300 TITAN X(Maxwell) v5.1 16 95
VGG16_reduced 300x300 TITAN X(Maxwell) v5.1 8 95
VGG16_reduced 300x300 TITAN X(Maxwell) v5.1 1 64
VGG16_reduced 300x300 TITAN X(Maxwell) N/A 8 36
VGG16_reduced 300x300 TITAN X(Maxwell) N/A 1 28

Forward time only, data loading and drawing excluded.

Getting started

  • Option #1 - install using 'Docker'. if you are not familiar with this technology, there is a 'Docker' section below. you can get the latest image:
docker pull daviddocker78/mxnet-ssd:gpu_0.12.0_cuda9
  • You will need python modules: cv2, matplotlib and numpy. If you use mxnet-python api, you probably have already got them. You can install them via pip or package manegers, such as apt-get:
sudo apt-get install python-opencv python-matplotlib python-numpy
  • Clone this repo:
# if you don't have git, install it via apt or homebrew/yum based on your system
sudo apt-get install git
# cd where you would like to clone this repo
cd ~
git clone --recursive https://github.com/zhreshold/mxnet-ssd.git
# make sure you clone this with --recursive
# if not done correctly or you are using downloaded repo, pull them all via:
# git submodule update --recursive --init
cd mxnet-ssd/mxnet
  • (Skip this step if you have offcial MXNet installed.) Build MXNet: cd /path/to/mxnet-ssd/mxnet. Follow the official instructions here.
# for Ubuntu/Debian
cp make/config.mk ./config.mk
# modify it if necessary

Remember to enable CUDA if you want to be able to train, since CPU training is insanely slow. Using CUDNN is optional, but highly recommanded.

Try the demo

# cd /path/to/mxnet-ssd
python demo.py --gpu 0
# play with examples:
python demo.py --epoch 0 --images ./data/demo/dog.jpg --thresh 0.5
python demo.py --cpu --network resnet50 --data-shape 512
# wait for library to load for the first time
  • Check python demo.py --help for more options.

Train the model

This example only covers training on Pascal VOC dataset. Other datasets should be easily supported by adding subclass derived from class Imdb in dataset/imdb.py. See example of dataset/pascal_voc.py for details.

  • Download the converted pretrained vgg16_reduced model here, unzip .param and .json files into model/ directory by default.
  • Download the PASCAL VOC dataset, skip this step if you already have one.
cd /path/to/where_you_store_datasets/
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
# Extract the data.
tar -xvf VOCtrainval_11-May-2012.tar
tar -xvf VOCtrainval_06-Nov-2007.tar
tar -xvf VOCtest_06-Nov-2007.tar
  • We are going to use trainval set in VOC2007/2012 as a common strategy. The suggested directory structure is to store VOC2007 and VOC2012 directories in the same VOCdevkit folder.
  • Then link VOCdevkit folder to data/VOCdevkit by default:
ln -s /path/to/VOCdevkit /path/to/this_example/data/VOCdevkit

Use hard link instead of copy could save us a bit disk space.

  • Create packed binary file for faster training:
# cd /path/to/mxnet-ssd
bash tools/prepare_pascal.sh
# or if you are using windows
python tools/prepare_dataset.py --dataset pascal --year 2007,2012 --set trainval --target ./data/train.lst
python tools/prepare_dataset.py --dataset pascal --year 2007 --set test --target ./data/val.lst --shuffle False
  • Start training:
python train.py
  • By default, this example will use batch-size=32 and learning_rate=0.004. You might need to change the parameters a bit if you have different configurations. Check python train.py --help for more training options. For example, if you have 4 GPUs, use:
# note that a perfect training parameter set is yet to be discovered for multi-gpu
python train.py --gpus 0,1,2,3 --batch-size 128 --lr 0.001
  • Memory usage: MXNet is very memory efficient, training on VGG16_reduced model with batch-size 32 takes around 4684MB without CUDNN(conv1_x and conv2_x fixed).

Evalute trained model

Use:

# cd /path/to/mxnet-ssd
python evaluate.py --gpus 0,1 --batch-size 128 --epoch 0

Convert model to deploy mode

This simply removes all loss layers, and attach a layer for merging results and non-maximum suppression. Useful when loading python symbol is not available.

# cd /path/to/mxnet-ssd
python deploy.py --num-class 20
# then you can run demo with new model without loading python symbol
python demo.py --prefix model/ssd_300_deploy --epoch 0 --deploy

Convert caffemodel

Converter from caffe is available at /path/to/mxnet-ssd/tools/caffe_converter

This is specifically modified to handle custom layer in caffe-ssd. Usage:

cd /path/to/mxnet-ssd/tools/caffe_converter
make
python convert_model.py deploy.prototxt name_of_pretrained_caffe_model.caffemodel ssd_converted
# you will use this model in deploy mode without loading from python symbol
python demo.py --prefix ssd_converted --epoch 1 --deploy

There is no guarantee that conversion will always work, but at least it's good for now.

Legacy models

Since the new interface for composing network is introduced, the old models have inconsistent names for weights. You can still load the previous model by rename the symbol to legacy_xxx.py and call with python train/demo.py --network legacy_xxx For example:

python demo.py --network 'legacy_vgg16_ssd_300.py' --prefix model/ssd_300 --epoch 0

Docker

First make sure docker is installed. The docker plugin nvidia-docker is required to run on Nvidia GPUs.

docker pull daviddocker78/mxnet-ssd:gpu_0.12.0_cuda9

Otherwise, if you wish to build it yourself, you have the Dockerfiles available in this repo, under the 'docker' folder.

  • to run a container instance:
nvidia-docker run -it --rm myImageName:tag

now you can execute commands the same way as you would, if you'd install mxnet on your own computer. for more information, see the Guide.

Tensorboard

  • There has been some great effort to bring tensorboard to mxnet. If you chose to work with dockers, you have it installed in the pre-built image you've downloaded. otherwise, follow here for installation steps.
  • To save training loss graphs, validation AP per class, and validation ROC graphs to tensorboard while training, you can specify:
python train.py --gpus 0,1,2,3 --batch-size 128 --lr 0.001 --tensorboard True
  • To save also the distributions of layers (actually, the variance of them), you can specify:
python train.py --gpus 0,1,2,3 --batch-size 128 --lr 0.001 --tensorboard True --monitor 40
  • Visualization with Docker: the UI of tensorboard has changed over time. to get the best experience, download the new tensorflow docker-image:
# download the built image from Dockerhub
docker pull tensorflow/tensorflow:1.4.0-devel-gpu
# run a container and open a port using '-p' flag. 
# attach a volume from where you stored your logs, to a directory inside the container
nvidia-docker run -it --rm -p 0.0.0.0:6006:6006 -v /my/full/experiment/path:/res tensorflow/tensorflow:1.4.0-devel-gpu
cd /res
tensorboard --logdir=.

To launch tensorboard without docker, simply run the last command Now tensorboard is loading the tensorEvents of your experiment. open your browser under '0.0.0.0:6006' and you will have tensorboard!

Tensorboard visualizations

loss AP ROC

mxnet-ssd's People

Contributors

bunnyshan avatar davsol avatar kkebo avatar rizhiy avatar touchdown avatar tri0l avatar zhreshold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mxnet-ssd's Issues

Error when run "python demo.py"

environment: windows 10, mxnet compiled from source

error message:
Traceback (most recent call last):
File "demo.py", line 95, in
ctx, args.nms_thresh, args.force_nms)
File "demo.py", line 39, in get_detector
.get_symbol(len(CLASSES), nms_thresh, force_nms)
File "D:\learning_mxnet\mxnet-ssd\symbol\symbol_vgg16_reduced.py", line 162, in get_symbol
net = get_symbol_train(num_classes)
File "D:\learning_mxnet\mxnet-ssd\symbol\symbol_vgg16_reduced.py", line 118, in get_symbol_train
clip=True, interm_layer=0)
File "D:\learning_mxnet\mxnet-ssd\symbol\common.py", line 111, in multibox_layer
from_layer = mx.symbol.Scale(data=from_layer, mode="spatial", \
AttributeError: module 'mxnet.symbol' has no attribute 'Scale'

And I didn't found a symbol "Scale" in the mxnet document. Is it a customized layer definition?

train_object_acc goes down during training

Hi,
I use this code to train on pascal dataset and I find that the train_objectacc goes down during training.
logs are like these:
Start training with (gpu(0)) from pretrained model /home/dyc/workspace/mxnet-ssd/model/vgg16_reduced
Freezed parameters: INFO:root:Epoch[1] Batch [20] Speed: 33.88 samples/sec Train-Acc=0.748112
INFO:root:Epoch[1] Batch [20] Speed: 33.88 samples/sec Train-ObjectAcc=0.009007
INFO:root:Epoch[1] Batch [20] Speed: 33.88 samples/sec Train-SmoothL1=98.478310
INFO:root:Epoch[1] Batch [40] Speed: 33.42 samples/sec Train-Acc=0.747074
INFO:root:Epoch[1] Batch [40] Speed: 33.42 samples/sec Train-ObjectAcc=0.007426
INFO:root:Epoch[1] Batch [40] Speed: 33.42 samples/sec Train-SmoothL1=93.499833
INFO:root:Epoch[1] Batch [60] Speed: 33.74 samples/sec Train-Acc=0.749589
INFO:root:Epoch[1] Batch [60] Speed: 33.74 samples/sec Train-ObjectAcc=0.003738
INFO:root:Epoch[1] Batch [60] Speed: 33.74 samples/sec Train-SmoothL1=95.395453
INFO:root:Epoch[1] Batch [80] Speed: 33.89 samples/sec Train-Acc=0.749490
INFO:root:Epoch[1] Batch [80] Speed: 33.89 samples/sec Train-ObjectAcc=0.003148
INFO:root:Epoch[1] Batch [80] Speed: 33.89 samples/sec Train-SmoothL1=87.185657
INFO:root:Epoch[1] Batch [100] Speed: 34.06 samples/sec Train-Acc=0.749362
INFO:root:Epoch[1] Batch [100] Speed: 34.06 samples/sec Train-ObjectAcc=0.001884
INFO:root:Epoch[1] Batch [100] Speed: 34.06 samples/sec Train-SmoothL1=101.286346
INFO:root:Epoch[1] Batch [120] Speed: 33.98 samples/sec Train-Acc=0.750000
INFO:root:Epoch[1] Batch [120] Speed: 33.98 samples/sec Train-ObjectAcc=0.000000
INFO:root:Epoch[1] Batch [120] Speed: 33.98 samples/sec Train-SmoothL1=95.370920

About the demo's speed

Hi, @zhreshold
I followed the instructions to setup this demo. And I found the speed is quite slow on my server----It took 0.39s to process one image. The environment is ubuntu14.04, cuda 8.0 , cudnn 5, TiTanX

caffemaker@gpuserver84:~/MXNet/mxnet-ssd/mxnet-ssd$ python demo.py --epoch 0 --images ./data/demo/000010.jpg --thresh 0.5
Detection time for 1 images: 0.3902 sec

Is this a right situation? If it is right, then how to reach the speed in the README.md? Thanks for help

mx.symbol.Scale not found

python train.py
Traceback (most recent call last):
File "train.py", line 80, in
args.lr_refactor_ratio, args.monitor, args.log_file)
File "/home/veilytech/DeepLearning2/mxnet-ssd/train/train_net.py", line 194, in train_net
net = importlib.import_module("symbol_" + net).get_symbol_train(imdb.num_classes)
File "/home/veilytech/DeepLearning2/mxnet-ssd/config/../symbol/symbol_vgg16_reduced.py", line 118, in get_symbol_train
clip=True, interm_layer=0)
File "/home/veilytech/DeepLearning2/mxnet-ssd/config/../symbol/common.py", line 111, in multibox_layer
from_layer = mx.symbol.Scale(data=from_layer, mode="spatial",
AttributeError: 'module' object has no attribute 'Scale'

How should I fix this problem? Thanks

compile error

3> 正在创建库 E:/opensource/mxnet-master/build/Debug/libmxnet.lib 和对象 E:/opensource/mxnet-master/build/Debug/libmxnet.exp
3>multibox_detection.obj : error LNK2019: 无法解析的外部符号 "class mxnet::Operator * __cdecl mxnet::op::CreateOp(struct mxnet::op::MultiBoxDetectionParam,int)" (??$CreateOp@Ugpu@mshadow@@@op@mxnet@@YAPEAVOperator@1@UMultiBoxDetectionParam@01@H@Z),该符号在函数 "public: virtual class mxnet::Operator * __cdecl mxnet::op::MultiBoxDetectionProp::CreateOperatorEx(struct mxnet::Context,class std::vector<class mxnet::TShape,class std::allocator > *,class std::vector<int,class std::allocator > *)const " (?CreateOperatorEx@MultiBoxDetectionProp@op@mxnet@@UEBAPEAVOperator@3@UContext@3@PEAV?$vector@VTShape@mxnet@@v?$allocator@VTShape@mxnet@@@std@@@std@@peav?$vector@HV?$allocator@H@std@@@7@@z) 中被引用
3>multibox_prior.obj : error LNK2019: 无法解析的外部符号 "class mxnet::Operator * __cdecl mxnet::op::CreateOp(struct mxnet::op::MultiBoxPriorParam,int)" (??$CreateOp@Ugpu@mshadow@@@op@mxnet@@YAPEAVOperator@1@UMultiBoxPriorParam@01@H@Z),该符号在函数 "public: virtual class mxnet::Operator * __cdecl mxnet::op::MultiBoxPriorProp::CreateOperatorEx(struct mxnet::Context,class std::vector<class mxnet::TShape,class std::allocator > *,class std::vector<int,class std::allocator > *)const " (?CreateOperatorEx@MultiBoxPriorProp@op@mxnet@@UEBAPEAVOperator@3@UContext@3@PEAV?$vector@VTShape@mxnet@@v?$allocator@VTShape@mxnet@@@std@@@std@@peav?$vector@HV?$allocator@H@std@@@7@@z) 中被引用
3>multibox_target.obj : error LNK2019: 无法解析的外部符号 "class mxnet::Operator * __cdecl mxnet::op::CreateOp(struct mxnet::op::MultiBoxTargetParam,int)" (??$CreateOp@Ugpu@mshadow@@@op@mxnet@@YAPEAVOperator@1@UMultiBoxTargetParam@01@H@Z),该符号在函数 "public: virtual class mxnet::Operator * __cdecl mxnet::op::MultiBoxTargetProp::CreateOperatorEx(struct mxnet::Context,class std::vector<class mxnet::TShape,class std::allocator > *,class std::vector<int,class std::allocator > *)const " (?CreateOperatorEx@MultiBoxTargetProp@op@mxnet@@UEBAPEAVOperator@3@UContext@3@PEAV?$vector@VTShape@mxnet@@v?$allocator@VTShape@mxnet@@@std@@@std@@peav?$vector@HV?$allocator@H@std@@@7@@z) 中被引用
3>cuda_compile_1_generated_convolution.cu.obj : error LNK2019: 无法解析的外部符号 cudnnConvolutionBackwardFilter_v3,该符号在函数 "public: virtual void __cdecl mxnet::op::CuDNNConvolutionOp::Backward(struct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator > const &,class std::vector<class mxnet::TBlob,class std::allocator > const &,class std::vector<class mxnet::TBlob,class std::allocator > const &,class std::vector<enum mxnet::OpReqType,class std::allocator > const &,class std::vector<class mxnet::TBlob,class std::allocator > const &,class std::vector<class mxnet::TBlob,class std::allocator > const &)" (?Backward@?$CuDNNConvolutionOp@M@op@mxnet@@UEAAXAEBUOpContext@3@AEBV?$vector@VTBlob@mxnet@@v?$allocator@VTBlob@mxnet@@@std@@@std@@11AEBV?$vector@W4OpReqType@mxnet@@v?$allocator@W4OpReqType@mxnet@@@std@@@6@11@Z) 中被引用
3>cuda_compile_1_generated_deconvolution.cu.obj : error LNK2001: 无法解析的外部符号 cudnnConvolutionBackwardFilter_v3
3>cuda_compile_1_generated_convolution.cu.obj : error LNK2019: 无法解析的外部符号 cudnnConvolutionBackwardData_v3,该符号在函数 "public: virtual void __cdecl mxnet::op::CuDNNConvolutionOp::Backward(struct mxnet::OpContext const &,class std::vector<class mxnet::TBlob,class std::allocator > const &,class std::vector<class mxnet::TBlob,class std::allocator > const &,class std::vector<class mxnet::TBlob,class std::allocator > const &,class std::vector<enum mxnet::OpReqType,class std::allocator > const &,class std::vector<class mxnet::TBlob,class std::allocator > const &,class std::vector<class mxnet::TBlob,class std::allocator > const &)" (?Backward@?$CuDNNConvolutionOp@M@op@mxnet@@UEAAXAEBUOpContext@3@AEBV?$vector@VTBlob@mxnet@@v?$allocator@VTBlob@mxnet@@@std@@@std@@11AEBV?$vector@W4OpReqType@mxnet@@v?$allocator@W4OpReqType@mxnet@@@std@@@6@11@Z) 中被引用
3>cuda_compile_1_generated_deconvolution.cu.obj : error LNK2001: 无法解析的外部符号 cudnnConvolutionBackwardData_v3
3>E:\opensource\mxnet-master\build\Debug\libmxnet.dll : fatal error LNK1120: 5 个无法解析的外部命令

Wrong number of priors computations ?

Hi,
Looks like there is a small bug in computing the number of anchors in mxnet-ssd/symbol/common.py at line 129: num_anchors = len(size) -1 + len(ratio)

Shouldn't it be something like:
num_anchors = (len(size) -1) * len(ratio) ???

train of ssd 500

@zhreshold
I have tested training of ssd 300 by command :
python train.py --gpus 0,1,2,3 --batch-size 128 --lr 0.0005.
Then I used command :
python train.py --gpus 0,1,2,3 --batch-size 128 --lr 0.0005 --data-shape 500.
It aslo worked.
But the original ssd500 is different from ssd300. Can I train ssd500 by this command?

Error when we predict on image and not from DataIter

when i try to call the model on one image with the example here : https://github.com/dmlc/mxnet/blob/master/tests/python/predict/mxnet_predict_example.py

my code :

    predictor = mx.model.FeedForward.load("model/ssd20161028_300", 10, ctx=mx.gpu(0), numpy_batch_size=1)
    img = cv2.imread('data/Total/JPEGImages/video_20160728_142541_299.jpg')
    img_arr = np.asarray(img)
    img_arr = np.swapaxes(img_arr, 0, 2)
    img_arr = np.swapaxes(img_arr, 1, 2)
    img2 = img_arr.reshape((1, 3, 960, 540))
    print predictor.predict(img2)[0]

I got this error on execution :

[17:34:32] /my/project/mxnet-ssd/mxnet/dmlc-core/include/dmlc/logging.h:235: [17:34:32] src/operator/./multibox_target-inl.h:274: Check failed: (lshape.ndim()) == (3) Label should be [batch-num_labels-5] tensor
Traceback (most recent call last):
  File "demo.py", line 95, in <module>
    print predictor.predict(img2)[0]
  File "/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/model.py", line 597, in predict
    self._init_predictor(data_shapes)
  File "/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/model.py", line 528, in _init_predictor
    self.ctx[0], grad_req='null', **dict(input_shapes))
  File "/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/symbol.py", line 671, in simple_bind
    arg_shapes, _, aux_shapes = self.infer_shape(**kwargs)
  File "/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/symbol.py", line 453, in infer_shape
    return self._infer_shape_impl(False, *args, **kwargs)
  File "/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/symbol.py", line 513, in _infer_shape_impl
    ctypes.byref(complete)))
  File "/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/base.py", line 77, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: InferShape Error in multibox_target: [17:34:32] src/operator/./multibox_target-inl.h:274: Check failed: (lshape.ndim()) == (3) Label should be [batch-num_labels-5] tensor

Have you any idea how to pass image to your model without DataIter ?

I got a TypeError when I run the demo.py,is this because of python3?

Traceback (most recent call last):
File "demo.py", line 98, in
CLASSES, args.thresh, args.show_timer)
File "E:\SSD\mxnet-ssd\detect\detector.py", line 163, in detect_and_visualize
dets = self.im_detect(im_list, root_dir, extension, show_timer=show_timer)
File "E:\SSD\mxnet-ssd\detect\detector.py", line 94, in im_detect
return self.detect(test_iter, show_timer)
File "E:\SSD\mxnet-ssd\detect\detector.py", line 60, in detect
detections = self.mod.predict(det_iter).asnumpy()
File "C:\Users\winan\Anaconda3\lib\site-packages\mxnet-0.7.0-py3.5.egg\mxnet\module\base_module.py", line 246, in predict
for nbatch, eval_batch in enumerate(eval_data):
File "C:\Users\winan\Anaconda3\lib\site-packages\mxnet-0.7.0-py3.5.egg\mxnet\io.py", line 66, in next
return self.next()
File "C:\Users\winan\Anaconda3\lib\site-packages\mxnet-0.7.0-py3.5.egg\mxnet\io.py", line 275, in next
if self.iter_next():
File "C:\Users\winan\Anaconda3\lib\site-packages\mxnet-0.7.0-py3.5.egg\mxnet\io.py", line 264, in iter_next
self.current_batch = DataBatch(sum([batch.data for batch in self.next_batch], []),
TypeError: can only concatenate list (not "dict_values") to list

About training parameters

I have been trying to reproduce the reported performance(71.57%) by training.

python train.py --gpus 0

then

python evaluate.py --gpus 0 --epoch 200

However, I only got mAP 69.79% with one GPU. I tried adding another 100 epochs and changing the learning rate and other parameters slightly. The best I can get is still only 69.98%.

Did I miss something? Does any one have the proper training parameters to achieve the reported performance?

Thanks!

I train ssd on a dataset which only has one class. When I run demo.py, there is an error.

I want to use ssd to detect text in images, so I train ssd on ICDAR dataset. I successfully train this model, and get the saved params and json on the folder 'Model'. Then I want see the performance of my model, so I run demo.py, but there is an error:
[15:02:26] /home/ubuntu/mxnet/dmlc-core/include/dmlc/logging.h:235: [15:02:26] src/ndarray/ndarray.cc:231: Check failed: from.shape() == to->shape() operands shape mismatch
Traceback (most recent call last):
File "demo.py", line 95, in
ctx, args.nms_thresh, args.force_nms)
File "demo.py", line 41, in get_detector
data_shape, mean_pixels, ctx=ctx)
File "/home/ubuntu/mxnet/example/ssd_LPR/detect/detector.py", line 39, in init
self.mod.set_params(args, auxs)
File "/home/ubuntu/mxnet/python/mxnet/module/base_module.py", line 503, in set_params
allow_missing=allow_missing, force_init=force_init)
File "/home/ubuntu/mxnet/python/mxnet/module/module.py", line 198, in init_params
_impl(name, arr, arg_params)
File "/home/ubuntu/mxnet/python/mxnet/module/module.py", line 188, in _impl
cache_arr.copyto(arr)
File "/home/ubuntu/mxnet/python/mxnet/ndarray.py", line 533, in copyto
return _internal._copyto(self, out=other)
File "/home/ubuntu/mxnet/python/mxnet/ndarray.py", line 1225, in unary_ndarray_function
c_array(ctypes.c_char_p, [c_str(str(i)) for i in kwargs.values()])))
File "/home/ubuntu/mxnet/python/mxnet/base.py", line 77, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [15:02:26] src/ndarray/ndarray.cc:231: Check failed: from.shape() == to->shape() operands shape mismatch

I have changed the class in demo.py like this:
CLASSES = ('text')

Fine Tuning

How to fine tune your model?
I don't have sufficient data to retrain your model from scratch.
I want to fine tune your model on my data which has only two classes ?

Where to find the MultiBoxTarget?

Hi,zhreshold. I want to find the implement of your customized MultiBoxTarget operation in the source file. Could you tell me where to find it. Thank you very much.

when I run make using gpu, there is an error that VarInfo is ambiguous.

example/ssd/operator/./multibox_detection-inl.h:115:136: error: call of overloaded 'VarInfo()' is ambiguous
DMLC_DECLARE_FIELD(variances).set_default(VarInfo({0.1f, 0.1f, 0.2f, 0.2f}))
^
example/ssd/operator/./multibox_detection-inl.h:115:136: note: candidates are:
example/ssd/operator/./multibox_detection-inl.h:30:10: note: mxnet::op::VarInfo::VarInfo(std::vector)
explicit VarInfo(std::vector in) : info(in) {}
^
example/ssd/operator/./multibox_detection-inl.h:28:8: note: mxnet::op::VarInfo::VarInfo(const mxnet::op::VarInfo&)
struct VarInfo {
^
example/ssd/operator/./multibox_detection-inl.h:28:8: note: mxnet::op::VarInfo::VarInfo(mxnet::op::VarInfo&&)
make: *** [example/ssd/operator/multibox_detection_gpu.o] Error 1

cannot find the files when i run demo.py

Traceback (most recent call last):
File "demo.py", line 2, in
import tools.find_mxnet
File "/media/ubuntu/266AA4086AA3D33B/ccCorkSpace/deeplearnings/ssd/src/mxnet-ssd/tools/find_mxnet.py", line 7, in
import mxnet as mx
File "/media/ubuntu/266AA4086AA3D33B/ccCorkSpace/deeplearnings/ssd/src/mxnet-ssd/tools/../mxnet/python/mxnet/init.py", line 7, in
from .base import MXNetError
File "/media/ubuntu/266AA4086AA3D33B/ccCorkSpace/deeplearnings/ssd/src/mxnet-ssd/tools/../mxnet/python/mxnet/base.py", line 43, in
_LIB = _load_lib()
File "/media/ubuntu/266AA4086AA3D33B/ccCorkSpace/deeplearnings/ssd/src/mxnet-ssd/tools/../mxnet/python/mxnet/base.py", line 34, in _load_lib
lib_path = libinfo.find_lib_path()
File "/media/ubuntu/266AA4086AA3D33B/ccCorkSpace/deeplearnings/ssd/src/mxnet-ssd/tools/../mxnet/python/mxnet/libinfo.py", line 36, in find_lib_path
'List of candidates:\n' + str('\n'.join(dll_path)))
RuntimeError: Cannot find the files.
List of candidates:
/media/ubuntu/266AA4086AA3D33B/ccCorkSpace/deeplearnings/ssd/src/mxnet-ssd/mxnet/python/mxnet/libmxnet.so
/media/ubuntu/266AA4086AA3D33B/ccCorkSpace/deeplearnings/ssd/src/mxnet-ssd/mxnet/python/mxnet/../../lib/libmxnet.so
/media/ubuntu/266AA4086AA3D33B/ccCorkSpace/deeplearnings/ssd/src/mxnet-ssd/mxnet/python/mxnet/../../build/Release/libmxnet.so
/usr/local/lib/libmxnet.so
/opt/ros/kinetic/lib/libmxnet.so
/usr/local/lib/libmxnet.so
/usr/local/cuda-8.0/lib64/libmxnet.so

What should i do to solve this problem

Reproducability

I'm trying to debug why I'm getting different results when using a single GPU vs multiple GPUs (All other parameters are the same).

First, I'm trying to fix the training initialization and randomization so I can compare the two options.
However, even with a single GPU the results do not repeat themselves even with seed:

numpy.random.seed(0)
mxnet.random.seed(0)
random.seed(0)

This should work according to apache/mxnet#736

Is there anything I'm missing?

support of batch norm

Hi, I wonder why the batch norm is not supported?
as stated in symbol/common.py

conv_act_layer(from_layer, name, num_filter, kernel=(1,1), pad=(0,0), \
    stride=(1,1), act_type="relu", use_batchnorm=False)
...
...
assert not use_batchnorm, "batchnorm not yet supported" 

very slow inference

Hi! when i run a inference using demo.py these take a lot of time (minimum 30 secs. I not speak about the detection time but the starting-net time), is it normal? there is some way to run faster the inferences? in others net or frameworks like Yolo in darknet, you can "activate" the net (load weights and more) and after you can load some images separately...something like this in mxnet?
Thanks in advance!

sizes of PriorBox wonder

   I find the sizes of PriorBox in your code 
    sizes = [[.1], [.2,.276], [.38, .461], [.56, .644], [.74, .825], [.92, 1.01]].
   The  original is 
       min_sizes = []
       max_sizes = []
      for ratio in xrange(min_ratio, max_ratio + 1, step):
             min_sizes.append( ratio / 100.)
             max_sizes.append((ratio + step) / 100.)
      min_sizes = [ 10 / 100.] + min_sizes
      max_sizes = [[]] + max_sizes 

 which can be translated as  [[0.1],[0.2,0.38],[0.38,0.56],[0.56,0.74],[0.74,0.92],[0.92,1.1]].

why do you left some space between ranges such as [.2,.276], [.38, .461]?

training accuracy cannot match ssd on caffe

Training for 200 epoch for batchsize 32, test on voc2007, only got 68 mAP.

Also it is very strange if batchsize > 32 when I train it on 2 or more GPUs. I have tested batchsize=64 using 2 gpus and 128 for 4 gpus, also I have try different parameters, the mAP is worse than batchsize = 32. I know caffe implementation for VGGNet use batch 32, but it is not reasonable for large batchsize but bad performance. Is there any special normalization in the loss layer?

I run demo.py , a error raise

Traceback (most recent call last):
File "E:/opensource/mxnet-master/example/ssd/demo.py", line 95, in
ctx, args.nms_thresh, args.force_nms)
File "E:/opensource/mxnet-master/example/ssd/demo.py", line 39, in get_detector
.get_symbol(len(CLASSES), nms_thresh, force_nms)
File "E:\opensource\mxnet-master\example\ssd\symbol\symbol_vgg16_reduced.py", line 163, in get_symbol
net = get_symbol_train(num_classes)
File "E:\opensource\mxnet-master\example\ssd\symbol\symbol_vgg16_reduced.py", line 54, in get_symbol_train
pooling_convention="full", name="pool3")
File "E:\opensource\mxnet\python\mxnet\symbol.py", line 1062, in creator
ctypes.byref(sym_handle)))
File "E:\opensource\mxnet\python\mxnet\base.py", line 77, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: Cannot find argument 'pooling_convention', Possible Arguments:

AttributeError: 'module' object has no attribute 'Scale'

Hello,i'm really interested in your project,but i have some problems when i run your project as follow:

Traceback (most recent call last):
File "demo.py", line 93, in
ctx, args.nms_thresh, args.force_nms)
File "demo.py", line 39, in get_detector
.get_symbol(len(CLASSES), nms_thresh, force_nms)
File "/home/jackqian/mxnet-ssd-master/symbol/symbol_vgg16_reduced.py", line 162, in get_symbol
net = get_symbol_train(num_classes)
File "/home/jackqian/mxnet-ssd-master/symbol/symbol_vgg16_reduced.py", line 118, in get_symbol_train
clip=True, interm_layer=0)
File "/home/jackqian/mxnet-ssd-master/symbol/common.py", line 111, in multibox_layer
from_layer = mx.symbol.Scale(data=from_layer, mode="spatial",
AttributeError: 'module' object has no attribute 'Scale'

it seems that we cannot find the module 'Scale'.
I really want to run this project in MXNet so i pluck up courage to ask you for help.i'll appreciate it if you can help me!
By the way,i‘m a new learner!
Thanks!

Slower than Caffe at test time

Hi,

I use both this version and original caffe version, and test same image (data/demo/dog.jpg) with GTX1070 GPU, CUDA 8.0, CUDNN 5.1

Caffe: 14 ms (71 fps)
MXNet: 33 ms (33 fps)

MXNet is 2x slower, is it normal ?

Thanks a lot

Error about Cuda

Hi
I got the following error when tried to excute demo.py

mxnet.base.MXNetError: [10:23:36] src/storage/storage.cc:50: Please compile with CUDA enabled

I thought Cuda is important if you intend to do training , but for now I am only interested to run demo.

Please advice

Thanks a lot

Failed to transfer caffe's prototxt .

  Thank you for good job! 
  I have used  mxnet-ssd\mxnet\tools\caffe_converter to convert  caffe's ssd300  deploy.prototxt to  mxnet's json file. The output is:
 google.protobuf.text_format.ParseError: 758:3 : Message type caffe.LayerParameter has no field named norm_param.

  Do I use it correctly?

'module' object has no attribute 'float16'

Hi, after install the mxnet package, I tried to run the train_mnist.py, but there are some problems:

sudo python example/image-classification/train_mnist.py --network lenet --gpus 0
Traceback (most recent call last):
  File "example/image-classification/train_mnist.py", line 1, in <module>
    import find_mxnet
  File "/home/PPeiMi/mxnet-ssd2/mxnet/example/image-classification/find_mxnet.py", line 2, in <module>
    import mxnet as mx
  File "/home/PPeiMi/mxnet-ssd2/mxnet/python/mxnet/__init__.py", line 9, in <module>
    from . import ndarray
  File "/home/PPeiMi/mxnet-ssd2/mxnet/python/mxnet/ndarray.py", line 25, in <module>
    np.float16 : 2,
AttributeError: 'module' object has no attribute 'float16'

My python version is 2.6.

How to convert ssd.caffemodel to mxnet_ssd.params?

For example, I have the VGG_VOC0712_SSD_300x300_iter_60000.caffemodel, and I want to get the same ssd_300-symbol.json and ssd_300-0000.params, would you show me how can I convert the ssd.caffemodel to mxnet_ssd.params and mxnet_ssd-symbol.json? Thank you.

I got this when I ran the demo.py

C:\Users\LST\mxnet-ssd-master>python demo.py
Traceback (most recent call last):
File "demo.py", line 7, in
from detect.detector import Detector
File "C:\Users\LST\mxnet-ssd-master\detect\detector.py", line 63
print "Detection time for {} images: {:.4f} sec".format(
^
SyntaxError: invalid syntax

with win10, anaconda3.THX~~

Training error Check failed: (temp.size()) >= (num_negative) in multibox_target.cc

When I try to run train.py, the "Check failed: (temp.size()) >= (num_negative)" in multibox_target.cc happens.
[11:43:24] D:\ODD\Code\MxNet\SSD_Master\mxnet\dmlc-core\include\dmlc/logging.h:235: [11:43:24] D:\ODD\Code\MxNet\SSD_Master\mxnet\src\operator\multibox_target.cc:217: Check failed: (temp.size()) >= (num_negative)
[11:43:24] D:\ODD\Code\MxNet\SSD_Master\mxnet\dmlc-core\include\dmlc/logging.h:235: [11:43:24] d:\odd\code\mxnet\ssd_master\mxnet\src\engine./threaded_engine.h :306: [11:43:24] D:\ODD\Code\MxNet\SSD_Master\mxnet\src\operator\multibox_target.cc:217: Check failed: (temp.size()) >= (num_negative)

An error raises when I run demo.py

Traceback (most recent call last):
File "./demo.py", line 95, in
ctx, args.nms_thresh, args.force_nms)
File "./demo.py", line 39, in get_detector
.get_symbol(len(CLASSES), nms_thresh, force_nms)
File "/home/sheny/mxnet-ssd/symbol/symbol_vgg16_reduced.py", line 162, in get_symbol
net = get_symbol_train(num_classes)
File "/home/sheny/mxnet-ssd/symbol/symbol_vgg16_reduced.py", line 118, in get_symbol_train
clip=True, interm_layer=0)
File "/home/sheny/mxnet-ssd/symbol/common.py", line 111, in multibox_layer
from_layer = mx.symbol.Scale(data=from_layer, mode="spatial",
AttributeError: 'module' object has no attribute 'Scale'

compilation fail on TX1 - call of overloaded is ambiguous due to explicit struct

Hi Joshua,

I ran into an issue compiling on an Nvidia Jetson TX1, with gcc-4.8.4, nvcc/CUDA v7.0, cmake 3.2.2, which seems to be due to the way a struct is defined in src/operator/<multibox_prior-inl.h, multibox_target-inl.h and multibox_detection-inl.h>. This only happens with some versions of gcc/g++, I believe because the tools have evolved in following the explicit keyword. Anyways, it was a simple fix. First, here's a (shortened) segment of my original make log output in case someone else is having the issue:

src/operator/./multibox_prior-inl.h:114:71: error: call of overloaded ‘SizeInfo(<brace-enclosed initializer list>)’ is ambiguous
DECLARE_FIELD(sizes).set_default(SizeInfo({1.0f}))
src/operator/./multibox_prior-inl.h:114:71: note: candidates are:
src/operator/./multibox_prior-inl.h:42:10: note: mxnet::op::SizeInfo::SizeInfo(std::vector<float>)
explicit SizeInfo(std::vector<float> in) : info(in) {}

What worked for me (I'm not a language expert but this made sense) was to instantiate the struct following the convention enforced by the explicit keyword, like so:

std::vector<float> InitStdVec = {0.1f, 0.1f, 0.2f, 0.2f};
VarInfo DefaultInitInfo = VarInfo(InitStdVec);
DECLARE_FIELD(sizes).set_default(DefaultInitInfo)

This is done in each of those three header files, where DMLC_DECLARE_FIELD is setting a default for VarInfo, VarsInfo and SizeInfo. I don't know if these changes would conflict on other variants of gcc/g++, so you may not want to do anything without more user feedback. Thank you Joshua, great work on porting SSD to mxnet!

Erik

Saving checkpoint failed !!

I used the framework to train the VGG16_reduced network on my own dataset. It trained well but I found it failed to save checkpoint. And the error traceback is as follows:

INFO:root:Saved checkpoint to "/home/caffemaker/MXNet/mxnet/example/ssd/model/ssd_500-0001.params"
[10:26:02] /home/caffemaker/MXNet/mxnet/dmlc-core/include/dmlc/logging.h:235: [10:26:02] src/ndarray/ndarray.cc:231: Check failed: from.shape() == to->shape() operands shape mismatch
Traceback (most recent call last):
  File "train_zface.py", line 78, in <module>
    args.lr_refactor_ratio, args.monitor, args.log_file)
  File "/home/caffemaker/MXNet/mxnet/example/ssd/train/train_net.py", line 201, in train_net_on_others
    monitor=monitor)
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/module/base_module.py", line 408, in fit
    batch_end_callback=eval_batch_end_callback, epoch=epoch)
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/module/base_module.py", line 169, in score
    self.forward(eval_batch, is_train=False)
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/module/module.py", line 388, in forward
    self._exec_group.forward(data_batch, is_train)
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/module/executor_group.py", line 319, in forward
    _load_label(data_batch, self.label_arrays, self.label_layouts)
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/module/executor_group.py", line 49, in _load_label
    _load_general(batch.label, targets, major_axis)
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/module/executor_group.py", line 36, in _load_general
    d_dst_copy.copyto(d_dst)
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/ndarray.py", line 533, in copyto
    return _internal._copyto(self, out=other)
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/ndarray.py", line 1225, in unary_ndarray_function
    c_array(ctypes.c_char_p, [c_str(str(i)) for i in kwargs.values()])))
  File "/home/caffemaker/MXNet/mxnet/python/mxnet/base.py", line 77, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [10:26:02] src/ndarray/ndarray.cc:231: Check failed: from.shape() == to->shape() operands shape mismatch

I changed the SSD_VGG16_Reduced architecture a little, including the from layers and the class numbers.
And I tried the framework in this repository and the dmlc repository ---- Same error.
Did I make some mistakes or is it a bug ? @zhreshold Thanks for help !

PR to MXNet/examples?

This looks cool. Would you like to PR it to mxnet main repo so we can make sure upstream updates don't break it?
Also if you can put numbers in readme it would be great.

cannot compile

After make

src/operator/./multibox_prior-inl.h: In member function ‘void mxnet::op::MultiBoxPriorParam::__DECLARE__(dmlc::parameter::ParamManagerSingleton<mxnet::op::MultiBoxPriorParam>*)’:
src/operator/./multibox_prior-inl.h:114:71: error: call of overloaded ‘SizeInfo(<brace-enclosed initializer list>)’ is ambiguous
     DMLC_DECLARE_FIELD(sizes).set_default(SizeInfo({1.0f}))
                                                                       ^
src/operator/./multibox_prior-inl.h:114:71: note: candidates are:
src/operator/./multibox_prior-inl.h:42:10: note: mxnet::op::SizeInfo::SizeInfo(std::vector<float>)
   explicit SizeInfo(std::vector<float> in) : info(in) {}
          ^
src/operator/./multibox_prior-inl.h:40:8: note: mxnet::op::SizeInfo::SizeInfo(const mxnet::op::SizeInfo&)
 struct SizeInfo {
        ^
src/operator/./multibox_prior-inl.h:40:8: note: mxnet::op::SizeInfo::SizeInfo(mxnet::op::SizeInfo&&)
src/operator/./multibox_prior-inl.h:116:73: error: call of overloaded ‘SizeInfo(<brace-enclosed initializer list>)’ is ambiguous
     DMLC_DECLARE_FIELD(ratios).set_default(SizeInfo({1.0f}))
                                                                         ^
src/operator/./multibox_prior-inl.h:116:73: note: candidates are:
src/operator/./multibox_prior-inl.h:42:10: note: mxnet::op::SizeInfo::SizeInfo(std::vector<float>)
   explicit SizeInfo(std::vector<float> in) : info(in) {}
          ^
src/operator/./multibox_prior-inl.h:40:8: note: mxnet::op::SizeInfo::SizeInfo(const mxnet::op::SizeInfo&)
 struct SizeInfo {
        ^
src/operator/./multibox_prior-inl.h:40:8: note: mxnet::op::SizeInfo::SizeInfo(mxnet::op::SizeInfo&&)
src/operator/./multibox_detection-inl.h: In member function ‘void mxnet::op::MultiBoxDetectionParam::__DECLARE__(dmlc::parameter::ParamManagerSingleton<mxnet::op::MultiBoxDetectionParam>*)’:
src/operator/./multibox_detection-inl.h:115:136: error: call of overloaded ‘VarInfo(<brace-enclosed initializer list>)’ is ambiguous
     DMLC_DECLARE_FIELD(variances).set_default(VarInfo({0.1f, 0.1f, 0.2f, 0.2f}))
                                                                                                                                        ^
src/operator/./multibox_detection-inl.h:115:136: note: candidates are:
src/operator/./multibox_detection-inl.h:30:10: note: mxnet::op::VarInfo::VarInfo(std::vector<float>)
   explicit VarInfo(std::vector<float> in) : info(in) {}
          ^
src/operator/./multibox_detection-inl.h:28:8: note: mxnet::op::VarInfo::VarInfo(const mxnet::op::VarInfo&)
 struct VarInfo {
        ^
src/operator/./multibox_detection-inl.h:28:8: note: mxnet::op::VarInfo::VarInfo(mxnet::op::VarInfo&&)
make: *** [build/src/operator/multibox_prior_gpu.o] 错误 1
make: *** 正在等待未完成的任务....
src/operator/./multibox_target-inl.h: In member function ‘void mxnet::op::MultiBoxTargetParam::__DECLARE__(dmlc::parameter::ParamManagerSingleton<mxnet::op::MultiBoxTargetParam>*)’:
src/operator/./multibox_target-inl.h:127:137: error: call of overloaded ‘VarsInfo(<brace-enclosed initializer list>)’ is ambiguous
     DMLC_DECLARE_FIELD(variances).set_default(VarsInfo({0.1f, 0.1f, 0.2f, 0.2f}))
                                                                                                                                         ^
src/operator/./multibox_target-inl.h:127:137: note: candidates are:
src/operator/./multibox_target-inl.h:42:10: note: mxnet::op::VarsInfo::VarsInfo(std::vector<float>)
   explicit VarsInfo(std::vector<float> in) : info(in) {}
          ^
src/operator/./multibox_target-inl.h:40:8: note: mxnet::op::VarsInfo::VarsInfo(const mxnet::op::VarsInfo&)
 struct VarsInfo {
        ^
src/operator/./multibox_target-inl.h:40:8: note: mxnet::op::VarsInfo::VarsInfo(mxnet::op::VarsInfo&&)

These file: src/operator/./multibox_target-inl.h, src/operator/./multibox_detection-inl.h, src/operator/./multibox_prior-inl.h, are updated 18 days ago. Is there any bugs in SizeInfo?

mxnet-ssd with NNPACK?

I want to speed up mxnet-ssd with NNPACK, but after I download the latest version of mxnet which supports NNPACK I found out that I cannot use it by simply replace the mxnet in your project(mx.symbol.Scale not found, which is already pointed out by Jiakui).
So are there any solutions about how to use the latest version of mxnet instead of the mxnet in your project or how to use NNPACK in the mxnet in your project?Any suggestions would be greatly appreciated.

mx.symbol.Scale not found

I installed MXNET using instructions from http://mxnet.io/get_started/osx_setup.html
with git clone --recursive https://github.com/dmlc/mxnet

then
I used git clone --recursive https://github.com/zhreshold/mxnet-ssd.git

I still have the same error when I try to excute demo.py
AttributeError: 'module' object has no attribute 'Scale'

I even tried
1-git clone --recursive https://github.com/zhreshold/mxnet.git and
2-edit the file tools/find_mxnet as mentioned in issue 11

but problem is not resolved

Thanks

Error on execution with custom trained model : Operands shape mismatch

I train a new model with this command :

python2 train.py --prefix ssd20161027 --devkit-path data/mydata/ --gpus 0 --val-image-set val --image-set train --year 2016 --batch-size 16

and when I test on datas (mines or demos) with :

python demo.py --epoch 4 --images data/mydata/JPEGImages/102355_119.jpg --thresh 0.5 --prefix ssd20161027

The script failed with this error :

[11:48:32] /path/to/my/project/mxnet-ssd/mxnet/dmlc-core/include/dmlc/logging.h:235: [11:48:32] src/ndarray/ndarray.cc:291: Check failed: from.shape() == to->shape() operands shape mismatch
Traceback (most recent call last):
  File "demo.py", line 95, in <module>
    ctx, args.nms_thresh, args.force_nms)
  File "demo.py", line 41, in get_detector
    data_shape, mean_pixels, ctx=ctx)
  File "/path/to/my/project/mxnet-ssd/detect/detector.py", line 37, in __init__
    self.mod.set_params(args, auxs)
  File "/path/to/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/module/base_module.py", line 478, in set_params
    allow_missing=allow_missing, force_init=force_init)
  File "/path/to/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/module/module.py", line 190, in init_params
    _impl(name, arr, arg_params)
  File "/path/to/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/module/module.py", line 180, in _impl
    cache_arr.copyto(arr)
  File "/path/to/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/ndarray.py", line 499, in copyto
    return _internal._copyto(self, out=other)
  File "/path/to/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/ndarray.py", line 1174, in unary_ndarray_function
    c_array(ctypes.c_char_p, [c_str(str(i)) for i in kwargs.values()])))
  File "/path/to/my/project/mxnet-ssd/tools/../mxnet/python/mxnet/base.py", line 77, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [11:48:32] src/ndarray/ndarray.cc:291: Check failed: from.shape() == to->shape() operands shape mismatch

I'm on ubuntu 16.04 with cuda 8.0 and cudnn5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.