czhu95 / ternarynet Goto Github PK
View Code? Open in Web Editor NEWImplementation for Trained Ternary Network.
License: Apache License 2.0
Implementation for Trained Ternary Network.
License: Apache License 2.0
Hi Chenzhuo!
I tried to train cifar10 by
python ./tw-cifar10-resnet.py --gpu 0
But, Traceback was occured.
Traceback (most recent call last):
File "./tw-cifar10-resnet.py", line 213, in <module>
config = get_config(args.n)
File "./tw-cifar10-resnet.py", line 197, in get_config
model=Model(n=nsize),
TypeError: Can't instantiate abstract class Model with abstract methods _get_inputs
My environment were below.
by conda install.
freetype 2.5.5 2
h5py 2.7.0 np112py36_0
hdf5 1.8.17 1
jbig 2.1 0
jpeg 8d 2
libgfortran 3.0.0 1
libpng 1.6.27 0
libprotobuf 3.2.0 0
libsodium 1.0.10 0
libtiff 4.0.6 2
lmdb 0.9.18 0
mkl 2017.0.1 0
msgpack-numpy 0.3.9 <pip>
msgpack-python 0.4.8 py36_0
nltk 3.2.2 py36_0
numpy 1.12.1 py36_0
opencv 3.1.0 np112py36_1
openssl 1.0.2k 2
pillow 3.4.2 py36_0
pip 9.0.1 py36_1
protobuf 3.2.0 py36_0
protobuf 3.3.0 <pip>
python 3.6.1 2
pyzmq 16.0.2 py36_0
readline 6.2 2
scipy 0.19.0 np112py36_0
setuptools 27.2.0 py36_0
six 1.10.0 py36_0
sqlite 3.13.0 0
tabulate 0.7.7 <pip>
tensorflow 1.1.0 np112py36_0
tensorpack 0.1.9 <pip>
termcolor 1.1.0 <pip>
tk 8.5.18 0
tqdm 4.11.2 py36_0
werkzeug 0.12.2 py36_0
Werkzeug 0.12.2 <pip>
wheel 0.29.0 py36_0
xz 5.2.2 1
zeromq 4.1.5 0
zlib 1.2.8 3
by pip install
appdirs (1.4.3)
h5py (2.7.0)
msgpack-numpy (0.3.9)
msgpack-python (0.4.8)
nltk (3.2.2)
numpy (1.12.1)
packaging (16.8)
Pillow (3.4.2)
pip (9.0.1)
protobuf (3.3.0)
pyparsing (2.2.0)
pyzmq (16.0.2)
scipy (0.19.0)
setuptools (35.0.2)
six (1.10.0)
tabulate (0.7.7)
tensorflow (1.1.0)
tensorpack (0.1.9)
termcolor (1.1.0)
tqdm (4.11.2)
Werkzeug (0.12.2)
wheel (0.29.0)
Hi Chenzhuo, @czhu95
The monkey-patch way to replace tf.get_variable is not useful in current version (tensorpack 0.8.5, TensorFlow 1.3.0). Codes can not generate Wn and Wp under above-mentioned platform.
Best regards,
Shangyu
Hi Chenzhuo,
I was studying your Ternarynet work and was trying to run the Alexnet+Imagenet training.
'python
./tw-imagenet-alexnet.py --gpu 0,1,2,3 --data MY_IMAGENET_PATH'
{I have arranged the data in the format expected by the ILSVRC12()}
I got the following AssertionError:
Command
protoc caffe.proto --python_out .
failed!
Where is it actually looking for caffe.proto? Is Caffe installation required for it to run?
Thanks and regards.
Hi there,
I'm trying to re-run p-cifar10-resnet.py, but I'm unable to find build_prune
Is this included in the repository?
Thanks
Hi @czhu95 ,
Thanks for providing the codes!
Recently I use your codes to ternarize a ResNet18 using CIFAR10. Firstly I use tensorpack to train a ResNet18 to validation error as 0.083. However, when I apply this as initial status and ternarize (using the example codes), as I use the default delta t=0.05 in your code, the validation error is always around 0.1843. I tried other t but it is still around 0.18, which is about 10% lower than your paper report.
Is there any tricks or mistake I made?
Best regards,
Shangyu
Hi @czhu95 ,
Thanks for your interesting work. I ran your code to reproduce your results of resnet on Cifar-10 from scratch. However I see the results are not similar as you reported because it might be not using finetune models of ResNet. How can I download finetuned models?
Thanks,
Hai
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.