Coder Social home page Coder Social logo

emilianogagliardiemanueleghelfi / cnn-compression-performance Goto Github PK

View Code? Open in Web Editor NEW
28.0 2.0 10.0 311.51 MB

A python script that automatise the training of a CNN, compress it through tensorflow (or ristretto) plugin, and compares the performance of the two networks

Python 99.09% Shell 0.91%
caffe-framework ristretto caffe cnn neural-network cache analysis mnist cifar10 model-compression model-comparison performance-analysis python scripting

cnn-compression-performance's Introduction

Introduction

For real world application, convolutional neural network(CNN) model can take more than 100MB of space and can be computationally too expensive. Therefore, there are multiple methods to reduce this complexity in the state of art. Ristretto is a plug-in to Caffe framework that employs several model approximation methods. For this projects, first a CNN model will be trained for Cifar-10 dataset with Caffe, then Ristretto will be use to generate multiple approximated version of the trained model using different schemes. The goal of this projects is comparison of the models in terms of execution performance, model size and cache utilizations in the test or inference phase. The same steps are done with Tensorflow and Quantisation tool. The quantisation schemes of Tensorflow and Ristretto are then compared.

Folder description

  • ristretto: contains the tools for caffe ristretto quantization
  • tf_quantize: contains the tools for tensorflow quantization

A more detailed description is inside the readme of each folder.

Results

Cache Misses

Authors

  • Emanuele Ghelfi
  • Emiliano Gagliardi

cnn-compression-performance's People

Contributors

dependabot[bot] avatar emanueleghelfi avatar emilianogagliardi 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

Watchers

 avatar  avatar

cnn-compression-performance's Issues

Testing model

Hello,
I am trying to test this model and facing issue while running workflow.py. it giving me error:
user_module = importlib.import_module(args.module_name[0])
TypeError: 'NoneType' object is not subscriptable

Can you please tell me what is missing?
Also, for mnist_models file 2conv_2fc.py is having below variables:
checkpoint_prefix = 'CNNs/mnist_models/net_serializations/2conv_2fc/net'
checkpoint_path = 'CNNs/mnist_models/net_serializations/2conv_2fc'
I am not able to get this path.

How to save the model after quantized?

I implement linear quantization by PyTorch,but after quantized, model's size unchanged,it still save in float format, how to save the quantized model? Thanks for your help.

a bytes-like object is required, not 'str'

Hello,
While Testing I am getting this error:

Traceback (most recent call last):
File "workflow.py", line 294, in
main(model_instance, strtobool(args.train[0]), strtobool(args.quantize[0]), strtobool(args.evaluate[0]))
File "workflow.py", line 252, in main
o_current_dict = perf_stderr2dict(o_perf_std_err)
File "workflow.py", line 186, in perf_stderr2dict
perf_output_list = perf_output.split("\n")
TypeError: a bytes-like object is required, not 'str'

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.