Giter Club home page Giter Club logo

jolibrain / deepdetect Goto Github PK

View Code? Open in Web Editor NEW
2.5K 131.0 560.0 105.79 MB

Deep Learning API and Server in C++14 support for Caffe, PyTorch,TensorRT, Dlib, NCNN, Tensorflow, XGBoost and TSNE

Home Page: https://www.deepdetect.com/

License: Other

CMake 2.35% Shell 7.59% C++ 86.66% C 0.10% Python 2.35% M4 0.12% Dockerfile 0.83%
deep-learning machine-learning caffe xgboost rest-api tsne object-detection image-segmentation image-classification neural-nets

deepdetect's Introduction

DeepDetect Logo

Open Source Deep Learning Server & API

Join the chat at https://gitter.im/beniz/deepdetect GitHub release (latest SemVer) GitHub Release Date GitHub commits since latest release (by date)

DeepDetect (https://www.deepdetect.com/) is a machine learning API and server written in C++11. It makes state of the art machine learning easy to work with and integrate into existing applications. It has support for both training and inference, with automatic conversion to embedded platforms with TensorRT (NVidia GPU) and NCNN (ARM CPU).

It implements support for supervised and unsupervised deep learning of images, text, time series and other data, with focus on simplicity and ease of use, test and connection into existing applications. It supports classification, object detection, segmentation, regression, autoencoders, ...

And it relies on external machine learning libraries through a very generic and flexible API. At the moment it has support for:

Please join the community on Gitter, where we help users get through with installation, API, neural nets and connection to external applications.


Build type STABLE DEVEL
SOURCE

All DeepDetect Docker images available from https://docker.jolibrain.com/.

  • To list all available images:
curl -X GET https://docker.jolibrain.com/v2/_catalog
  • To list an image available tags, e.g. for the deepdetect_cpu image:
curl -X GET https://docker.jolibrain.com/v2/deepdetect_cpu/tags/list

Main features

  • high-level API for machine learning and deep learning
  • support for Caffe, Tensorflow, XGBoost, T-SNE, Caffe2, NCNN, TensorRT, Pytorch
  • classification, regression, autoencoders, object detection, segmentation, time-series
  • JSON communication format
  • remote Python and Javacript clients
  • dedicated server with support for asynchronous training calls
  • high performances, benefit from multicore CPU and GPU
  • built-in similarity search via neural embeddings
  • connector to handle large collections of images with on-the-fly data augmentation (e.g. rotations, mirroring)
  • connector to handle CSV files with preprocessing capabilities
  • connector to handle text files, sentences, and character-based models
  • connector to handle SVM file format for sparse data
  • range of built-in model assessment measures (e.g. F1, multiclass log loss, ...)
  • range of special losses (e.g Dice, contour, ...)
  • no database dependency and sync, all information and model parameters organized and available from the filesystem
  • flexible template output format to simplify connection to external applications
  • templates for the most useful neural architectures (e.g. Googlenet, Alexnet, ResNet, convnet, character-based convnet, mlp, logistic regression, SSD, DeepLab, PSPNet, U-Net, CRNN, ShuffleNet, SqueezeNet, MobileNet, RefineDet, VOVNet, ...)
  • support for sparse features and computations on both GPU and CPU
  • built-in similarity indexing and search of predicted features, images, objects and probability distributions

Machine Learning functionalities per library

Caffe Caffe2 XGBoost TensorRT NCNN Libtorch Tensorflow T-SNE Dlib
Serving
Training (CPU) Y Y Y N/A N/A Y N Y N
Training (GPU) Y Y Y N/A N/A Y N Y N
Inference (CPU) Y Y Y N Y Y Y N/A Y
Inference (GPU) Y Y Y Y N Y Y N/A Y
Models
Classification Y Y Y Y Y Y Y N/A Y
Object Detection Y Y N Y Y N N N/A Y
Segmentation Y N N N N N N N/A N
Regression Y N Y N N Y N N/A N
Autoencoder Y N N/A N N N N N/A N
NLP Y N Y N N Y N Y N
OCR / Seq2Seq Y N N N Y N N N N
Time-Series Y N N N Y Y N N N
Data
CSV Y N Y N N N N Y N
SVM Y N Y N N N N N N
Text words Y N Y N N N N N N
Text characters Y N N N N N N Y N
Images Y Y N Y Y Y Y Y Y
Time-Series Y N N N Y N N N N

Tools and Clients

Models

Caffe Tensorflow Source Top-1 Accuracy (ImageNet)
AlexNet Y N BVLC 57.1%
SqueezeNet Y N DeepScale 59.5%
Inception v1 / GoogleNet Y Y BVLC / Google 67.9%
Inception v2 N Y Google 72.2%
Inception v3 N Y Google 76.9%
Inception v4 N Y Google 80.2%
ResNet 50 Y Y MSR 75.3%
ResNet 101 Y Y MSR 76.4%
ResNet 152 Y Y MSR 77%
Inception-ResNet-v2 N Y Google 79.79%
VGG-16 Y Y Oxford 70.5%
VGG-19 Y Y Oxford 71.3%
ResNext 50 Y N https://github.com/terrychenism/ResNeXt 76.9%
ResNext 101 Y N https://github.com/terrychenism/ResNeXt 77.9%
ResNext 152 Y N https://github.com/terrychenism/ResNeXt 78.7%
DenseNet-121 Y N https://github.com/shicai/DenseNet-Caffe 74.9%
DenseNet-161 Y N https://github.com/shicai/DenseNet-Caffe 77.6%
DenseNet-169 Y N https://github.com/shicai/DenseNet-Caffe 76.1%
DenseNet-201 Y N https://github.com/shicai/DenseNet-Caffe 77.3%
SE-BN-Inception Y N https://github.com/hujie-frank/SENet 76.38%
SE-ResNet-50 Y N https://github.com/hujie-frank/SENet 77.63%
SE-ResNet-101 Y N https://github.com/hujie-frank/SENet 78.25%
SE-ResNet-152 Y N https://github.com/hujie-frank/SENet 78.66%
SE-ResNext-50 Y N https://github.com/hujie-frank/SENet 79.03%
SE-ResNext-101 Y N https://github.com/hujie-frank/SENet 80.19%
SENet Y N https://github.com/hujie-frank/SENet 81.32%
VOC0712 (object detection) Y N https://github.com/weiliu89/caffe/tree/ssd 71.2 mAP
InceptionBN-21k Y N https://github.com/pertusa/InceptionBN-21K-for-Caffe 41.9%
Inception v3 5K N Y https://github.com/openimages/dataset
5-point Face Landmarking Model (face detection) N N http://blog.dlib.net/2017/09/fast-multiclass-object-detection-in.html
Front/Rear vehicle detection (object detection) N N http://blog.dlib.net/2017/09/fast-multiclass-object-detection-in.html

More models:

References

Authors

DeepDetect is designed, implemented and supported by Jolibrain with the help of other contributors.

deepdetect's People

Contributors

alx avatar beniz avatar bycob avatar cchadowitz avatar conchylicultor avatar corentinb avatar dgtlmoon avatar essim avatar fantes avatar gitter-badger avatar jsaksris avatar kyrs avatar marcreichman avatar marcreichman-pfi avatar panchishin avatar quadeare avatar r2d3 avatar royale avatar semantic-release-bot avatar sileht avatar xoolive avatar yayab avatar yuduowu 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  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

deepdetect's Issues

building error on ubuntu 14.04.

Error happens when making by following the official building steps:
(Titan X, with drivers and cuda 7.5, cudnn 3 properly installed)

git clone https://github.com/beniz/deepdetect.git
cd deepdetect
mkdir build
cd build 
cmake .. -DUSE_CUDNN=ON
make

error messages:

......
NVCC src/caffe/layers/batch_reindex_layer.cu
NVCC src/caffe/layers/contrastive_loss_layer.cu
NVCC src/caffe/layers/slice_layer.cu
NVCC src/caffe/layers/tile_layer.cu
NVCC src/caffe/layers/elu_layer.cu
NVCC src/caffe/layers/silence_layer.cu
NVCC src/caffe/layers/softmax_layer.cu
NVCC src/caffe/layers/cudnn_softmax_layer.cu
NVCC src/caffe/layers/sigmoid_layer.cu
NVCC src/caffe/layers/im2col_layer.cu
NVCC src/caffe/layers/cudnn_conv_layer.cu
NVCC src/caffe/layers/eltwise_layer.cu
NVCC src/caffe/layers/exp_layer.cu
NVCC src/caffe/layers/prelu_layer.cu
NVCC src/caffe/layers/absval_layer.cu
NVCC src/caffe/layers/dropout_layer.cu
NVCC src/caffe/util/math_functions.cu
NVCC src/caffe/util/im2col.cu
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
/usr/bin/ld: cannot find -lopenblas
collect2: error: ld returned 1 exit status
make[3]: *** [.build_release/lib/libcaffe.so] Error 1
make[2]: *** [caffe_dd/src/caffe_dd-stamp/caffe_dd-configure] Error 2
make[1]: *** [CMakeFiles/caffe_dd.dir/all] Error 2
make: *** [all] Error 2

It seems like caffe is not compiled successfully.

Crash on request with invalid url

Hi,
I've identified an issue that causes deepdetect to crash. It seems requests to an invalid domain cause an unhandled exception. This is similar to #45 but the issue is separate.
I'm using a recent build of deepdetect (Jan 11th, commit 6116a0c) on Ubuntu, which includes the fix that was made for #45

Request to a valid domain with a valid image -> good reply, returns with code 200:

curl -X POST "http://host.com:8080/predict" -d "{\"service\":\"imgnet\",\"parameters\":{\"input\":{\"width\":224,\"height\":224},\"output\":{\"best\":5}},\"data\":[\"https://upload.wikimedia.org/wikipedia/commons/c/cd/US-NASA-Seal-EO10849.jpg\"]}"
{"status":{"code":200,"msg":"OK"},"head":{"method":"/predict","time":1938.0,"service":"imgnet"},"body":{"predictions":{"uri":"https://upload.wikimedia.org/wikipedia/commons/c/cd/US-NASA-Seal-EO10849.jpg","classes":[{"prob":0.3491594195365906,"cat":"n04548280 wall clock"},{"prob":0.22876758873462678,"cat":"n03706229 magnetic compass"},{"prob":0.14928314089775086,"cat":"n02708093 analog clock"},{"prob":0.07048133760690689,"cat":"n04192698 shield, buckler"},{"last":true,"prob":0.0419003888964653,"cat":"n04355338 sundial"}]}}}

Request to a valid domain with an invalid image url -> returns with code 400

curl -X POST "http://host.com:8080/predict" -d "{\"service\":\"imgnet\",\"parameters\":{\"input\":{\"width\":224,\"height\":224},\"output\":{\"best\":5}},\"data\":[\"https://upload.wikimedia.org/wikipedia/commons/c/cd/US-NASA-Seal-EO108l49.jpg\"]}"
{"status":{"code":400,"msg":"BadRequest","dd_code":1005,"dd_msg":"Service Input Error"}}

Request to an invalid domain -> crashes, unhandled exception

curl -X POST "http://host.com:8080/predict" -d "{\"service\":\"imgnet\",\"parameters\":{\"input\":{\"width\":224,\"height\":224},\"output\":{\"best\":5}},\"data\":[\"https://upload.wikimedia_bad.org/wikipedia/commons/c/cd/US-NASA-Seal-EO108l49.jpg\"]}"
curl: (52) Empty reply from server
[1]+  Aborted                 (core dumped) nohup ./deepdetect/build/main/dede --host host.com

Thanks for your help with this issue.
Best,
Yann

Create Deepdetect server on 0.0.0.0:80 on AWS EC2

Dear community
I am trying to create deepdetect server on aws ec2.
When I type this command, ./main/dede -host 0.0.0.0 -port 80

I get this following
DeepDetect [ commit 8080e7b80i999ba444e671780a80fa4d1afdai0 ]
Running DeepDetect HTTP server on 0.0.0.0:80
terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injector<std::runtime_error >'
what(): Error binding to socket.
Aborted (core dumped)

Does anyone know how to solve this issue?
I want to allow HTTP access.

Thank you very much for your kind help in advance.

convnet template for Caffe + API control of convnet architecture

Adding control of convolutional neural network architecture through a template for Caffe + API parameters (i.e. similar to the `"template":"mlp" and 'layers' parameters).

Typically, layers=["2CR32","2CR64","1000"] should create a convolutional net with 2 consecutive 32 filters convolutional layers, followed by relu and pooling, then 2 consecutive 64 filters convolutional layers, then a full connected layer of 1000 neurons.

Deepdetect crashes often without any warning

I get an aborted (core dumped) message every so often and Deepdetect stops. I am using it to tag images with the imagenet model

Sometimes the issue is obvious such as a very large image or a dead link, but often it is just a normal image for no discernible reason.

Memory GPU leak, possibly with Caffe services

There is a weird leak behavior with Caffe:

  • the first service running Caffe almost determines the leak by leaving a leak behind. The size of the leak is directly proportional to the size of the training dataset
  • the leak appears to be independent from the input connector (witnessed for both CSV and text)
  • leak grow slowly with every new service, proportionally to initial size. This suggests that a structure somewhere is being incremented, with initial size set by the first run service.

First set of investigations appears to rule out the Caffe's net destruction, and first valgrind pass does not reveal much yet.

Linker error during installation

Hello Beniz,

I keep getting linker errors when I'm trying to install:
"deepdetect/build/caffe_dd/src/caffe_dd/build/lib/libcaffe.so: undefined reference to `cudaEventRecord' "

Any idea which Makefile or config I need to change?

Thanks very much

Building on Ubuntu 15.10 / GCC-5 with new ABI

This is an anchor post on how to build for gcc5 with new ABI, which is the recommended option on Ubuntu 15.10.

Warning: Ubuntu 15.10 has buggy libraries that are not correctly compiled with gcc5, requiring some of the kung-fu below. I have filed bug reports, will update when fixes occur.

  • Ubuntu 15.10 comes with libprotobuf compiled with gcc5 so Caffe should compile without difficulties (this is automatic when building deepdetect)
  • the built-in package for curlpp is wrongly compiled currently on Ubuntu 15.10 and will faill due to ABI mismatch. I've open a bug report but in the meantime the fix is to rebuild curlpp from https://github.com/datacratic/curlpp:
sudo apt-get remove libcurlpp0
git clone https://github.com/datacratic/curlpp
cd curlpp
./autogen.sh
./configure --prefix=/usr --enable-ewarning=no
make
sudo make install
wget https://launchpad.net/ubuntu/+archive/primary/+files/cpp-netlib_0.11.1%2Bdfsg1.orig.tar.gz
tar xvzf cpp-netlib_0.11.1+dfsg1.orig.tar.gz
cd cpp-netlib-0.11.1-final
mkdir build
cd build
cmake ..
make
sudo make install

That's it, deepdetect builds fine from me and all tests pass cleanly.

Text Classification in Deep Detect

Hi,

Great job on making Caffe as a service. I wanted to find out a few more details about the text classification capabilities in Deep Detect. Are you using a embed layer (word2vec or bag of words)? Can you point me to the relevant caffe layers and any article references?

Thanks!
V

Potential error in googlenet example in documentation ("setup of an image classifier")

I have tried the step-by-step example in the doc for setting up an image classifier (http://www.deepdetect.com/tutorials/imagenet-classifier/) based on googlenet (successfull dede installation incl run test on commit 66ff4af). I am successfull in setting up the service ({"status":{"code":201,"msg":"Created"}}), but I am failing in tests as follows:

In: curl -X POST "http://localhost:8080/predict" -d "{"service":"imageserv","parameters":{"input":{"width":224,"height":224},"output":{"best":3}},"data":["http://i.ytimg.com/vi/0vxOhd4qlnA/maxresdefault.jpg"]}"

Out: {"status":{"code":500,"msg":"InternalError","dd_code":1007,"dd_msg":"./include/caffe/layer.hpp:389 / Check failed (custom): (ExactNumTopBlobs()) == (top.size())"}}

Comments:

  1. Error code seems to hint at mismatch of some blob size in bvlc_googlenet.caffemodel vs. deploy.prototxt, however the trained model is coming directly from caffe model zoo and deploy.prototxt from ~/deepdetect/build/templates/caffe/googlenet/ is untouched (and copied by dede to ~/deepdetect/models/imgnet)
  2. A comparison of deploy.prototxt with the original deploy.prototxt from caffe (without MemoryData layer) looks identical
  3. When running the same code with alexnet (instead of googlenet, and after adjusting image size to 227) it is working

Any ideas why I am failing the googlenet example?

Authentication / login

@beniz is there currently a way to use authentication in deepdetect, for example something like basic http authentication, i.e. special http header with username:password via https, or anything else? (btw: many thanks for this fantastic tool!)

Document steps for using a custom version of Caffe along with DeepDetect

Caffe being a fast moving library, some developers may be interested in running with their own version of Caffe.

DeepDetect by default relies on https://github.com/beniz/caffe/tree/master_dd_integ which closely tracks the Caffe master branch and includes a short set of patches, mainly for error handling (see BVLC/caffe#1683) and getting control over some internal variables.

Subtasks:

  • release the DeepDetect patches to Caffe
  • document the steps to using a custom version of Caffe

Amazon Machine Instance (AMI) on EC2

Providing AMI is a good idea to ease deployment for some users.

Related links of interest:
- Deprecated Caffe AMI: https://github.com/BVLC/caffe/wiki/Ubuntu-14.04-ec2-instance
- Newly contributed Caffe AMI (that includes Torch): http://blog.titocosta.com/post/110345699197/public-~ec2-ami-with-torch-and-caffe-deep-learning
- Another Caffe AMI and Docker: BVLC/caffe#1092 (comment)
- An AMI for deep learning, and that contains Caffe: https://www.kaggle.com/forums/f/208/getting-started/t/11505/an-aws-ami-mainly-for-deep-learning

After a long wait, the official AMIs with support for Caffe, XGBoost and Tensorflow backends are available for both GPU and CPU:

See https://deepdetect.com/products/ami/ for thorough documentation.

Error while converting to TensorFlow model

I am trying to convert the clothing dataset to a model compatible wth TensorFlow using https://github.com/ethereon/caffe-tensorflow.

I am getting the following error:
"Error encountered: Cannot determine dimensions of data layer.
See comments in function shape_identity for more info."

The comment on the shape_identity function says:

We most likely have a data layer on our hands. The problem is,

# Caffe infers the dimensions of the data from the source (eg: LMDB).
# We want to avoid reading datasets here. Fail for now.
# This can be temporarily fixed by transforming the data layer to
# Caffe's "input" layer (as is usually used in the "deploy" version).
# TODO: Find a better solution for this.

Can someone suggest the necessary changes in deploy.prototxt file?

Add support for automatic handling of categorical data in CSV input connector

Some theoretical frameworks, and typically neural nets, only take reals or integer as input. The CSV input connector should convert categorical string data to integers (one-hot-vector or other) automatically, and spit out the mapping to the user/caller as necessary.

  • Specification of categorical variables via the API and CSV input connector
  • One-hot vector encoding
  • Encoding returned through API

Age model fails with error

I am trying to use model from https://github.com/GilLevi/AgeGenderDeepLearning
Everything starts normally but when I send request for prediction it fails with error:

INFO - Ignoring source layer data
dede: /usr/include/boost/smart_ptr/shared_ptr.hpp:653: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = caffe::MemoryDataLayer<float>; typename boost::detail::sp_member_access<T>::type = caffe::MemoryDataLayer<float>*]: Assertion `px != 0' failed.
INFO - Ignoring source layer lossAborted (core dumped)

Text input connector

Current input connectors include CSV and images. This issue adds the support for text, and the ability to train supervised neural networks on arbitrary text collections.

Main subtasks:

  • Bag-of-Words (BoW) input connector (Word2vec support to be the focus of another issue)
  • Support for reading large collections of text from repositories
  • One-hot-vector encoding for neural net input in Caffe
  • Serialization of vocabulary table

Other options will follow in dedicated issues, such as:

  • Full TF/IDF support and experiments (first round of experiments show degraded performances)
  • Support for n-grams and skip-grams
  • Sentence iterators

Caffe BlockingQueue locks on mutex when peeking after a service has exception

In some cases, when a training service fails on CUDA memory allocation or other errors at model loading time, it seems the lock on Caffe BlockingQueue isn't released.

In server logs, this typically looks like server is hanging on:

INFO - Creating layer data
INFO - Creating Layer data
INFO - data -> data
INFO - data -> label

and upon debugging:

#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x000000000046f473 in boost::condition_variable::wait (this=0x7eff7562d348, m=...) at /usr/include/boost/thread/pthread/condition_variable.hpp:73
#2  0x00007ffff5c69e38 in caffe::BlockingQueue<caffe::Datum*>::peek() ()
from /build/lib/libcaffe.so

Possibly comes from the Caffe Solver object not being released upon exception. To be investigated shortly.

multi-target neural net regression

As a follow up to #1, see https://github.com/beniz/deepdetect/issues/1#issuecomment-137553339

Steps:

  • gather a small and well-known dataset for multi-target regression that implementation can be checked against easily
  • set a working training / prediction model with Caffe
  • include the multi-target model definition to API as needed
  • add to model template construction code
  • add to unit tests

Discussing whether this does use the scheme recommended in BVLC/caffe#881 (comment) or some other (simpler ?) way that requires patching Caffe, might be required.

(Also, multi-target regression (and classification) do not mix well with the image connector typically, that uses the repository name as the single class (no regression supported yet) label.)

Support for training from large CSV files with Caffe, independently of available RAM

Current CSV connector loads CSV file into memory. For large datasets with millions or billions of rows and potentially many thousands of features, this is impractical.

Branch large-scale-csv holds the following features, unlocking the training from large CSV files independently from available memory:

  • direct CSV to database (lmdb) conversion with no memory overhead
  • scaling of data
  • MLP template for training with Caffe, with minibatches being taken from the database

Important: the shuffle component of the CSV input connector is not available when using the above database-based storage of large CSV datasets. A direct consequence is that the dataset must be pre-shuffled and that the training and testing files must be prepared before being passed to the DeepDetect CSV input connector.

Python API client

A Python API client, to ease the interaction with the API.

Two pieces:

  • a Python library to embed into any application
  • a Python CLI that uses the library to interact with the API from the command line

Support for TensorFlow

See short discussion here, tensorflow/tensorflow#85

In fact, ability to save computation graph models as protobuffers then read them up and providing data at runtime, not too different than with Caffe.

The API has been designed to absorb more libraries, and this is a nice test case that should allow to expand to more complex models such as seq2seq without breaking compatibility through API.

Additional relevant doc:

Failed compilation with g++ <= 4.8.x

shared_mutex header is not in gcc 4.8.x and below, yielding compilation error

mlservice.h:30:24: fatal error: shared_mutex: No such file or directory
 #include <shared_mutex>

An alternative would be to rely on boost shared_mutex instead.

Access to inner neural net's layers through API

A series of applications (e.g. #55) require access to the learnt features captured by a neural net's inner/hidden layers. (hyper-columns are not covered here).

This task requires:

  • New mllib parameter, e.g. extract_layer to capture one ore more layer names of interest to be returned by predict call
  • API boolean activator parameter, e.g. binarized in the output connector
  • Layer needs to be accessed from the net Caffe object in caffelib.cpp
  • Ability to output n-d vectors through API: this is similar to having an output connector for unsupervised job (e.g. same task as clustering and returning points' coordinates)

Discussion on these matters is always welcome.

Support for Spatial Transformer Networks

Spatial Transformers act as a warping / attention mechanism useful for a variety of tasks.

There's a handful of repositories implementing STN for Caffe, see BVLC/caffe#3114

However, STN have not made it into official Caffe yet, so it would need to be added to dd Caffe backend https://github.com/beniz/caffe/tree/master_dd_integ and rebased as Caffe recently changed the distribution of layers in C++ files.

Original paper: http://arxiv.org/abs/1506.02025

Implementations of interest:

Applications of interest:

  • Efficient downsampling
  • Learning of affine transformation for image classification
  • Attention mechanism for fine-grained image classification

problem using the pretrained model

I was trying to build a system using the pretrained model available here: http://www.deepdetect.com/applications/model/

I downloaded the .tar.gz2 files for the clothing class. I then tried to build a simple python script using caffe to use the files provided with the pretrained model. But when I was creating the caffe Classifier class I faced a very strange error.

This is how I created the classifier class in caffe using Python,

network_model = "./deploy.prototxt"
pretrained_network = "./model_iter_300000.caffemodel"
net = caffe.Classifier(network_model,pretrained_network,mean=np.load("mean.npy"), raw_scale=255, channel_swap=(2, 1, 0), image_dims=(256,256))

The deploy.prototxt and the model_iter_300000.caffemodel are the files which are present inside the .tar.gz2 file
The mean.npy file is created using the mean.binaryproto file present inside the .tar.gz2 file.

and the error that I was getting was

I1130 08:07:26.102867 4413 net.cpp:248] Memory required for data: 1764597888 Traceback (most recent call last): File "predict.py", line 32, in mean=np.load("mean.npy"), raw_scale=256, channel_swap=(2, 1, 0), image_dims=(256,256)) File "/home/caffe/python/caffe/classifier.py", line 29, in **init** in_ = self.inputs[0] IndexError: list index out of range

Can any one help me with this strange error?

Thanks

Support for neural net regression models

Regression tasks need to be supported in addition to supervised tasks with a finite number of labels.

Applications range from multi-target prediction to image rescaling with deep learning.

Subtasks:

  • Image and CSV connectors handling of regression target
  • MLP template support for regression
  • Unit tests in ut-caffeapi
  • Example and documentation

Support for OpenCV3

Linking CXX executable dede
/usr/bin/ld: ../src/libddetect.a(caffelib.cc.o): undefined reference to symbol '_ZN2cv6imreadERKNS_6StringEi'
/usr/local/lib/libopencv_imgcodecs.so.3.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
main/CMakeFiles/dede.dir/build.make:90: recipe for target 'main/dede' failed
make[2]: *** [main/dede] Error 1
CMakeFiles/Makefile2:160: recipe for target 'main/CMakeFiles/dede.dir/all' failed
make[1]: *** [main/CMakeFiles/dede.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

Error using gpu while prediction

Hello.
I've built DeepDetect docker image using kaixhin/cuda (https://hub.docker.com/r/kaixhin/cuda/~/dockerfile/ ) as base image. Here https://gist.github.com/skeeph/a1722053872552c62594 is my Dockerfile. I've built it without any errors.
After that, I create image classification service from tutorial. It works properly, with gpu=false.
But if i try to use gpu on prediction stage, by stating gpu=true in service creating api call, i have next situation. Trying to classificate any image, i have error
{ "status": { "code": 500, "dd_code": 1007, "dd_msg": "src/caffe/common.cpp:142 / Check failed (custom): (error) == (cudaSuccess)", "msg": "InternalError" } }
I have server with installed NVidia Tesla K80.

What is my error? Is it possible to use gpu on prediction?
Thanks.

Building of a binary hash code image similarity search application

Hi community,

I would like to implement binary hash code search application as it is written in this paper, 'Deep Learning of Binary Hash Code' to enable fast image similarity match. Specifically, I want to use googlenet and achieve the similarity search with elasticsearch on aws EC2.

Since we need to take the feature vector from the network as the hash code, I believe we need to output value from the hidden layer (One layer before the final output softmax layer) in convolutional network, but deepdetect library currently does not support the output of the values.

Please kindly help me if anyone have done this before.
I appreciate any kind of supports.

Thank you very much for providing this awesome library.
Masaki

Deepdetect text training errors out on non-gpu server

I followed the install guides and got dede running on an AWS ec2 m3.large.

$ ./main/dede
libdc1394 error: Failed to initialize libdc1394
DeepDetect [ commit 6116a0c8984300438b4323bbad44c5d8ca9c2080 ]
Running DeepDetect HTTP server on localhost:8080

In going through the text training tutorial (http://www.deepdetect.com/tutorials/txt-training/), it runs and then crashes.

1 - Creating the service

$ curl -X PUT "http://localhost:8080/services/n20" -d "{\"mllib\":\"caffe\",\"description\":\"newsgroup classification service\",\"type\":\"supervised\",\"parameters\":{\"input\":{\"connector\":\"txt\"},\"mllib\":{\"template\":\"mlp\",\"nclasses\":20,\"layers\":[200,200],\"activation\":\"relu\"}},\"model\":{\"templates\":\"../templates/caffe/\",\"repository\":\"models/n20\"}}"
{"status":{"code":201,"msg":"Created"}}
$

2 - Training the service

 curl -X POST "http://localhost:8080/train" -d "{\"service\":\"n20\",\"async\":true,\"parameters\":{\"mllib\":{\"gpu\":true,\"solver\":{\"iterations\":2000,\"test_interval\":200,\"base_lr\":0.05},\"net\":{\"batch_size\":300}},\"input\":{\"shuffle\":true,\"test_split\":0.2,\"min_count\":2,\"min_word_length\":2,\"count\":false},\"output\":{\"measure\":[\"mcll\",\"f1\"]}},\"data\":[\"models/n20/news20\"]}"
{"status":{"code":201,"msg":"Created"},"head":{"method":"/train","job":1,"status":"running"}}

3 - Checking on the job: RUNNING

$ curl -X GET "http://localhost:8080/train?service=n20&job=1"
{"status":{"code":200,"msg":"OK"},"head":{"method":"/train","job":1,"status":"running","time":6.0},"body":{"measure":{}}}

4 - Checking on the job: ERROR

$ curl -X GET "http://localhost:8080/train?service=n20&job=1"
{"status":{"code":200,"msg":"OK"},"head":{"method":"/train","job":1,"status":"error"},"body":{}}

5 - Meanwhile, over under ./main/dede

INFO - Creating layer inputl
INFO - Creating Layer inputl
INFO - inputl -> data
INFO - inputl -> label
ERROR - service n20 training status call failed

ERROR - {"code":500,"msg":"InternalError","dd_code":1007,"dd_msg":"./include/caffe/syncedmem.hpp:26 / Check failed (custom): *ptr"}

What am I doing wrong?

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.