kunglab / ebnn Goto Github PK
View Code? Open in Web Editor NEWHeader-only C library for Binary Neural Network Feedforward Inference (targeting small devices)
License: MIT License
Header-only C library for Binary Neural Network Feedforward Inference (targeting small devices)
License: MIT License
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
So I was interested in reading more about virtualenv, but the link on the README led to a 404 page with some charming ascii art. Consider replacing the link with this address: https://virtualenv.pypa.io/en/stable/userguide/.
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?
i have a error happen that is "from link_bst import BST
ImportError: No module named 'link_bst'"
Could you tll me how to solve it
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?
After refactoring bdot, we no longer have support for fully connected layers without softmax.
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
Hello Brad,
Can you please add the python file that trains a binary network based on cifar10?
Regards
Hassan
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.