Coder Social home page Coder Social logo

jnbraun / bcnn Goto Github PK

View Code? Open in Web Editor NEW
45.0 7.0 9.0 1.6 MB

A minimalist Deep Learning framework for embedded Computer Vision

License: MIT License

CMake 0.80% C 54.47% Cuda 5.04% C++ 37.56% Assembly 2.14%
convolutional-neural-networks deep-learning edge-ai computer-vision high-performance gpu embedded-vision c99 arm

bcnn's Introduction

BCNN

Build Status License

Introduction

BCNN (Bare Convolutional Neural Networks) is a minimalist framework designed to prototype, train and deploy convolutional neural networks for embedded computer vision applications.

Features

  • Written in C99. Clean C API designed to be integrated in C or C++ codebase.
  • Lightweight: the minimal build requires no external dependency.
  • Modular: Can leverage a Blas library such as OpenBLAS on CPU. Can also run on Nvidia's GPU. CuDNN is supported to offer maximal speed.
  • Fast: Optimized CPU inference speed using AVX and ARM Neon vectorizations and OpenMP multithreading.
  • Flexible: Supports multi inputs / outputs / branches. Provides the commonly used operators to build state-of-the-art CNN architectures (ResNet, DenseNet, MobileNet, Yolo ...)
  • Command line tool to train / evaluate models via simple configuration file.
  • Online data augmentation via bip, a fast image processing library (usable as standalone module).
  • (Experimental) Model converters from Caffe -> bcnn and bcnn -> TensorFlow Lite.

Getting started

Download or clone the repository:

git clone https://github.com/jnbraun/bcnn.git

You need to have cmake installed in order to build the library.

[Optional] Dependencies

CPU

  • Minimal build: no external dependency.
  • Build with Blas: requires a blas library (OpenBLAS is recommended).

GPU

Requires CUDA libraries (cudart, cublas, curand) and a GPU with compute capability 2.0 at least. CuDNN is optional but supported.

Build

  • User configuration: Depending on you system, you may want to edit the following lines of the CMakeLists.txt:
# User configuration settings
option(USE_AVX "Build with AVX instructions" ON)
option(USE_CUDA "Build with CUDA libraries" OFF)
option(USE_CUDNN "Build with CuDNN library" OFF)
option(USE_BLAS "Build with BLAS library" ON)
option(USE_NEON "Build with Neon instructions" OFF)
option(USE_OPENMP "Enable OpenMP multithreading" ON)
  • [Optional] When building with CUDA and / or CuDNN, you may need to adjust the following line depending on the compute capability of your GPU:
# Uncomment the proper line according to the system cuda arch
set(CUDA_ARCH 
    #"-gencode arch=compute_30,code=sm_30;"
    #"-gencode arch=compute_35,code=sm_35;"
    "-gencode arch=compute_50,code=sm_50;"
    "-gencode arch=compute_50,code=compute_50;"
    "-gencode arch=compute_52,code=sm_52;"
    #"-gencode arch=compute_60,code=sm_60;"
    #"-gencode arch=compute_61,code=sm_61;"
)
  • Build
cd path/to/bcnn
mkdir build
cd build/
cmake ../
make

How to use it

  • Use the command line tool bcnn-cl with configuration file: see an example here.

  • Or use the static library and write your own code: see an example there.

License

Released under MIT license.

bcnn's People

Contributors

jnbr avatar jnbraun 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bcnn's Issues

Deep learning

Hi
Happy new year!
sorry
I would like to ask something else
what courses did you take and what books did you read on neural networks and deep learning?
can you recommend resources in which development is shown from scratch?
like http://neuralnetworksanddeeplearning.com/

On make I am getting this cblas error.

[ 88%] Linking C executable bin/bcnn-cl
/usr/bin/ld: lib/libbcnn.a(bcnn_conv_layer.c.o): in function bcnn_forward_conv_layer_cpu': bcnn_conv_layer.c:(.text+0x234f): undefined reference to cblas_sgemm'
/usr/bin/ld: lib/libbcnn.a(bcnn_conv_layer.c.o): in function bcnn_backward_conv_layer_cpu': bcnn_conv_layer.c:(.text+0x26f7): undefined reference to cblas_sgemm'
/usr/bin/ld: bcnn_conv_layer.c:(.text+0x27e1): undefined reference to cblas_sgemm' /usr/bin/ld: bcnn_conv_layer.c:(.text+0x284b): undefined reference to cblas_sgemm'
/usr/bin/ld: lib/libbcnn.a(bcnn_fc_layer.c.o): in function bcnn_forward_fullc_layer_cpu': bcnn_fc_layer.c:(.text+0x9bb): undefined reference to cblas_sgemm'
/usr/bin/ld: lib/libbcnn.a(bcnn_fc_layer.c.o):bcnn_fc_layer.c:(.text+0xc29): more undefined references to `cblas_sgemm' follow
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/bcnn-cl.dir/build.make:93: bin/bcnn-cl] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/bcnn-cl.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Many thanks!

question

sorry can you give your email address or where is it convenient for you to chat? I wanted to ask something about the framework and skills.

Cannot Build with cuda support

Hi Jean,
Thank you very much for your contributions to open source community.
I would like to use bcnn with CUDA support on. when I set them on in CmakeLists.txt

cmake .. ends up with errors.

I have installed cuda and nvcc --version does return following ;

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

I suspect this could be because of lacking of maybe some symbolic links ?
Have you met this problem ?

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.