Giter Site home page Giter Site logo

deepcompression-caffe's People

Contributors

may0324 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepcompression-caffe's Issues

编译的时候头文件没有masks_等参数的定义

您好:
我在编译的时候发现cpp文件中有masks_参数的运用,但是头文件中没有定义一系列参数,是在其他地方定义的吗?

/home4/jiashuaihe/environment/caffe/src/caffe/layers/cmp_conv_layer.cu(63): error: class "caffe::CmpConvolutionLayer" has no member "masks_"
detected during instantiation of "void caffe::CmpConvolutionLayer::Forward_gpu(const std::vector<caffe::Blob *, std::allocator<caffe::Blob *>> &, const std::vector<caffe::Blob *, std::allocator<caffe::Blob *>> &) [with Dtype=float]"
(132): here

when run the last Quantization, Floating point exception(SIGFPE)

*** Aborted at 1531205735 (unix time) try "date -d @1531205735" if you are using GNU date ***
PC: @ 0x7fae1722831b caffe::CmpConvolutionLayer<>::compute_output_shape()
*** SIGFPE (@0x7fae1722831b) received by PID 5626 (TID 0x7fae17e3e740) from PID 388137755; stack trace: ***
@ 0x7fae155754b0 (unknown)
@ 0x7fae1722831b caffe::CmpConvolutionLayer<>::compute_output_shape()
@ 0x7fae17123efc caffe::BaseConvolutionLayer<>::Reshape()
@ 0x7fae171ec2f2 caffe::CuDNNCmpConvolutionLayer<>::Reshape()
@ 0x7fae172882b8 caffe::Net<>::ForwardFromTo()
@ 0x7fae17288667 caffe::Net<>::Forward()
@ 0x7fae1726c4c0 caffe::Solver<>::Step()
@ 0x7fae1726cf59 caffe::Solver<>::Solve()
@ 0x40b408 train()
@ 0x4075a8 main
@ 0x7fae15560830 __libc_start_main
@ 0x407d19 _start
@ 0x0 (unknown)
Floating point exception (core dumped)

Anyone encountered this problem?
@liu666666 @A-suozhang

Weired problem when pruning fc6 of caffenet

Hi, @may0324

Thanks for your cool work!

After cloned this code, we have been trying to replicate Han's work in pruning conv-nets, especially the large one like caffenet, a variant of AlexNet.

In pruning fc6, the first fully connected layer in the network, we observed that, this layer can be pruned with the sparsity at most 0.4444444, that is, when you set the parameter sparse_ratio to any number larger than 0.45, the actual sparsity is 0.4444444. This is rather weird to me.

Have you ever encountered this problem? Or could you please share your advice?

Thanks again!

Cheers!

有几个Caffe层实现的疑问

作者你好,我看到全连接和卷积分别有带前缀cmp的实现。

  1. 这里的mask_data是该层被剪枝的权重在原矩阵中的位置嘛?
  2. 实现了K均值聚类后读取类中心嘛?下面代码中这一行muweight[i] = cent_data[indice_data[i]];是否是对应的实现?
template <typename Dtype>
void CmpInnerProductLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
    const vector<Blob<Dtype>*>& top) {
  Dtype* muweight = this->blobs_[0]->mutable_cpu_data();
  const int *mask_data = this->masks_.cpu_data();
  int count = this->blobs_[0]->count();

  for (int i = 0; i < count; ++i)
    muweight[i] *= mask_data[i] ;

  if(this->quantize_term_)
  {
    const Dtype *cent_data = this->centroids_.cpu_data();
    const int *indice_data = this->indices_.cpu_data();

    for (int i = 0; i < count; ++i)
    {
       if (mask_data[i])
         muweight[i] = cent_data[indice_data[i]];
    }
  }

  const Dtype* bottom_data = bottom[0]->cpu_data();
  Dtype* top_data = top[0]->mutable_cpu_data();
  const Dtype* weight = this->blobs_[0]->cpu_data();
  caffe_cpu_gemm<Dtype>(CblasNoTrans, transpose_ ? CblasNoTrans : CblasTrans,
      M_, N_, K_, (Dtype)1.,
      bottom_data, weight, (Dtype)0., top_data);
  if (bias_term_) {
    caffe_cpu_gemm<Dtype>(CblasNoTrans, CblasNoTrans, M_, N_, 1, (Dtype)1.,
        bias_multiplier_.cpu_data(),
        this->blobs_[1]->cpu_data(), (Dtype)1., top_data);
  }
}

感谢~

Individual processing

Hi @may0324

Thanks for your awesome work. So far, I know the following
spare_ratio: 0 means disable pruning
quantize_term: false means disable quantization.
But I saw defalut value for class_num is 256. It seems weight sharing is always perform, right? Could we disable this?
If I am wrong, please correct me. Thanks :)

.cu version

Some of the weights become very large when I run the gpu version. There may be some problems in "quantize_weight_backward".

Can it also work on VGG-16?

Dear may0324:
At first, I must appreciate your time and effort on the tutorial. This is very excellent. Actually, I need some tools to prune VGG-16 for my research. Thus, may I ask a question ? Could the tool also work well on VGG-16? Will it be complex to implement pruning VGG-16? (Don't care the accuracy)

snapshot crasp

when snapshot start, it crash.

I0721 11:04:23.275313 17167 solver.cpp:244]     Train net output #0: acc = 0.428571
I0721 11:04:23.275321 17167 solver.cpp:244]     Train net output #1: loss = 1.88784 (* 1 = 1.88784 loss)
I0721 11:04:23.275328 17167 sgd_solver.cpp:106] Iteration 9, lr = 0.001
I0721 11:04:23.275475 17167 solver.cpp:454] Snapshotting to binary proto file dataset/lenet_iter_10.caffemodel```

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

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.