Giter Site home page Giter Site logo

kunglab / ebnn Goto Github PK

View Code? Open in Web Editor NEW
45.0 2.0 18.0 11.91 MB

Header-only C library for Binary Neural Network Feedforward Inference (targeting small devices)

License: MIT License

C 68.03% Python 31.97%
neural-network embedded-devices feedforward-inference

ebnn's People

Contributors

bradmcdanel avatar mingodad avatar steerapi 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

ebnn's Issues

cifar10 do not work with chainer-2.1

cifar10 do not work with chainer-2.1. mnist works.

python simple.py --verbose --dataset cifar10

Traceback (most recent call last):
File "simple.py", line 15, in
util.train_model(model, train, test, args)
File "/home/fabio/cnn/ebnn/ebnn/examples/util.py", line 50, in train_model
trainer.run()
File "/usr/local/lib/python2.7/dist-packages/chainer/training/trainer.py", line 296, in run
update()
File "/usr/local/lib/python2.7/dist-packages/chainer/training/updater.py", line 223, in update
self.update_core()
File "/usr/local/lib/python2.7/dist-packages/chainer/training/updater.py", line 234, in update_core
optimizer.update(loss_func, *in_arrays)
File "/usr/local/lib/python2.7/dist-packages/chainer/optimizer.py", line 528, in update
loss = lossfun(*args, **kwds)
File "/home/fabio/cnn/ebnn/ebnn/examples/net.py", line 26, in call
h = self.l1(x)
File "/home/fabio/cnn/ebnn/ebnn/ebnn/links/link_conv_pool_BN_BST.py", line 29, in call
h = self.bconv(h)
File "/home/fabio/cnn/ebnn/ebnn/ebnn/links/link_binary_convolution.py", line 57, in call
x, self.W, self.b, self.stride, self.pad)
File "/home/fabio/cnn/ebnn/ebnn/ebnn/functions/function_binary_convolution_2d.py", line 306, in binary_convolution_2d
return func(x, W, b)
File "/usr/local/lib/python2.7/dist-packages/chainer/function.py", line 188, in call
self._check_data_type_forward(in_data)
File "/usr/local/lib/python2.7/dist-packages/chainer/function.py", line 292, in _check_data_type_forward
self.check_type_forward(in_type)
File "/home/fabio/cnn/ebnn/ebnn/ebnn/functions/function_binary_convolution_2d.py", line 49, in check_type_forward
x_type.shape[1] == w_type.shape[1],
File "/usr/local/lib/python2.7/dist-packages/chainer/utils/type_check.py", line 514, in expect
expr.expect()
File "/usr/local/lib/python2.7/dist-packages/chainer/utils/type_check.py", line 472, in expect
'{0} {1} {2}'.format(left, self.inv, right))
chainer.utils.type_check.InvalidType:
Invalid operation is performed in: BinaryConvolution2DFunction (Forward)

Expect: in_types[0].shape[1] == in_types[1].shape[1]
Actual: 3 != 1

pip show chainer

Name: chainer
Version: 2.1.0
Summary: A flexible framework of neural networks
Home-page: http://chainer.org/
Author: Seiya Tokui
Author-email: [email protected]
License: MIT License
Location: /usr/local/lib/python2.7/dist-packages
Requires: filelock, mock, nose, numpy, protobuf, six, cupy

Running simple.py

After cloning the git repo and using setup.py build/ install, simply.py will not run.
I get this error ->
eBNN/lib/python3.6/site-packages/hybrid-1-py3.6.egg/chainer_sequential/init.py", line 3, in
ModuleNotFoundError: No module named 'util'

I am not sure why it is trying to access the .egg file as though it is a directory. Is there any assistance I can receive to get simple.py running?

bslice_4d spent to big time in profiling

Hi,
i realize the profiling with a proprietary microcontroller and simulator(not arduino).
My analysis is that the bslice_4d function spent too time in the total time inference.
Is is possible develop a "bslice_4d less" algoritm or more efficient bslice_4d function?

alexnet do not work with dataset cifar10

python alex.py --verbose --dataset cifar10

Traceback (most recent call last):
File "alex.py", line 15, in
util.train_model(model, train, test, args)
File "/home/fabio/cnn/ebnn/ebnn/examples/util.py", line 50, in train_model
trainer.run()
File "/usr/local/lib/python2.7/dist-packages/chainer/training/trainer.py", line 296, in run
update()
File "/usr/local/lib/python2.7/dist-packages/chainer/training/updater.py", line 177, in update
self.update_core()
File "/usr/local/lib/python2.7/dist-packages/chainer/training/updater.py", line 188, in update_core
optimizer.update(loss_func, *in_arrays)
File "/usr/local/lib/python2.7/dist-packages/chainer/optimizer.py", line 527, in update
loss = lossfun(*args, **kwds)
File "/home/fabio/cnn/ebnn/ebnn/examples/net.py", line 76, in call
h = self.conv1(x)
File "/home/fabio/cnn/ebnn/ebnn/ebnn/links/link_conv_pool_BN_BST.py", line 29, in call
h = self.bconv(h)
File "/home/fabio/cnn/ebnn/ebnn/ebnn/links/link_binary_convolution.py", line 57, in call
x, self.W, self.b, self.stride, self.pad)
File "/home/fabio/cnn/ebnn/ebnn/ebnn/functions/function_binary_convolution_2d.py", line 306, in binary_convolution_2d
return func(x, W, b)
File "/usr/local/lib/python2.7/dist-packages/chainer/function.py", line 187, in call
self._check_data_type_forward(in_data)
File "/usr/local/lib/python2.7/dist-packages/chainer/function.py", line 290, in _check_data_type_forward
self.check_type_forward(in_type)
File "/home/fabio/cnn/ebnn/ebnn/ebnn/functions/function_binary_convolution_2d.py", line 49, in check_type_forward
x_type.shape[1] == w_type.shape[1],
File "/usr/local/lib/python2.7/dist-packages/chainer/utils/type_check.py", line 514, in expect
expr.expect()
File "/usr/local/lib/python2.7/dist-packages/chainer/utils/type_check.py", line 472, in expect
'{0} {1} {2}'.format(left, self.inv, right))
chainer.utils.type_check.InvalidType:
Invalid operation is performed in: BinaryConvolution2DFunction (Forward)

Expect: in_types[0].shape[1] == in_types[1].shape[1]
Actual: 3 != 1

fixed point or binary input image

Is it possible change the net to use only fixed point or binary input?
Exclude floating point totally inner the binary net?
This permits to run this c example also in micro without FPU.

module 'cupy.cudnn' has no attribute 'cudnn'

Hello Brad

when I tried to run alex.py, I run into this 'AttributeError:module 'cupy.cudnn' has no attribute 'cudnn''

The detail is as following:

/usr/bin/python3.5 /home/carrera/WebAR/ebnn/examples/alex.py
/usr/local/lib/python3.5/dist-packages/h5py/init.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "/home/carrera/WebAR/ebnn/examples/alex.py", line 4, in
import net
File "/home/carrera/WebAR/ebnn/examples/net.py", line 10, in
import ebnn.links as BL
File "/home/carrera/WebAR/ebnn/ebnn/links/init.py", line 77, in
from .link_binary_convolution import BinaryConvolution2D
File "/home/carrera/WebAR/ebnn/ebnn/links/link_binary_convolution.py", line 12, in
from ..functions.function_binary_convolution_2d import binary_convolution_2d
File "/home/carrera/WebAR/ebnn/ebnn/functions/function_binary_convolution_2d.py", line 11, in
libcudnn = cuda.cudnn.cudnn
AttributeError: module 'cupy.cudnn' has no attribute 'cudnn'

This is my environment : pycharm , chainer4.2.0 , cupy4.2.0 , cuda9.0 , cudnn7.0.5

Do you know how to solve this problem?

Thank you
Carrera

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.