ethanhe42 / channel-pruning Goto Github PK
View Code? Open in Web Editor NEWChannel Pruning for Accelerating Very Deep Neural Networks (ICCV'17)
Home Page: https://arxiv.org/abs/1707.06168
License: MIT License
Channel Pruning for Accelerating Very Deep Neural Networks (ICCV'17)
Home Page: https://arxiv.org/abs/1707.06168
License: MIT License
Operating system: CentOS7
CUDA version: 8.0
CUDNN version: 6.0
openCV version: 2.4.5
BLAS: open
Python version: 3.6.1
I want to know the data url
https://pan.baidu.com/s/1dDizyed#list/path=%2FImageNet
is good for use?
the channels of full connection Conv did not be pruned actually, while the most parameters also were not Conv, so how to improve the speed of model pruned?
python3 train.py -action c3 -gpu GPU0
usage: experiment [-h] [-tf TF_VIS] [-caffe CAFFE_VIS] [-action ACTION]
[-dic.keep DICDOTKEEP] [-dic.vh DICDOTVH]
[-dic.fitfc DICDOTFITFC] [-dic.rank_tol DICDOTRANK_TOL]
[-dic.afterconv DICDOTAFTERCONV]
[-dic.prepooling DICDOTPREPOOLING] [-dic.debug DICDOTDEBUG]
[-dic.option DICDOTOPTION]
[-dic.layeralpha DICDOTLAYERALPHA] [-dic.alter DICDOTALTER]
[-an.l1 ANDOTL1] [-an.l2 ANDOTL2] [-an.ratio ANDOTRATIO]
[-an.filter ANDOTFILTER] [-res.bn RESDOTBN]
[-res.short RESDOTSHORT] [-nPointsPerLayer NPOINTSPERLAYER]
[-nofc NOFC] [-ls LS] [-autodet AUTODET] [-fc_reg FC_REG]
[-kernelname KERNELNAME] [-data DATA] [-Action ACTION]
[-ntest NTEST] [-nBatches_fc NBATCHES_FC] [-solver SOLVER]
[-prototxt PROTOTXT] [-nBatches NBATCHES] [-model MODEL]
[-fc_ridge FC_RIDGE] [-nonlinear_fc NONLINEAR_FC]
[-frozen FROZEN] [-splitconvrelu SPLITCONVRELU]
[-weights WEIGHTS] [-mp MP] [-log LOG] [-shm SHM]
experiment: error: unrecognized arguments: -gpu GPU0
no lighting pack
How to work?
I your paper 4.1.2 section:
< Remaining channels ratios for shallow layers (conv1_x to conv3_x) and deep layers (conv4_x)
is 1 : 1:5. conv5_x are not pruned>
I set 3.0 rations for shollow layers and 1.5 rations for conv4_x, but the accuracy drop 0.77
Can you tell me how can i set channel rations ?
no
Sorry to trouble
when conv = ‘conv2_1’ and convnext = 'conv2_2'
In CR step , X_name='conv2_1' and convnext = 'conv2_2'
My problem is why don't use X_name = self.bottom_names['conv2_2'][0] and X_name = 'relu2_1' ?
Hi Yihui,
I tried your code and met some problems.
After make -j8 and make pycaffe, I tried to python3 train.py, but found something wrong with protobuf.
So I change the protobuf version but the problem was still not solved.
Here is the problem:
When I tried protobuf 3.0.0(b1,b2,b3,b4) or 3.1.0 , the error message is:
Failed to include caffe_pb2, things might go wrong!
Traceback (most recent call last):
File "/home/dutianyuan/anaconda3/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 1087, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "/home/dutianyuan/anaconda3/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 1109, in InternalParse
(tag_bytes, new_pos) = local_ReadTag(buffer, pos)
File "/home/dutianyuan/anaconda3/lib/python3.5/site-packages/google/protobuf/internal/decoder.py", line 181, in ReadTag
while six.indexbytes(buffer, pos) & 0x80:
TypeError: unsupported operand type(s) for &: 'str' and 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 19, in <module>
from lib.net import Net, load_layer, caffe_test
File "/mnt/lustre/dutianyuan/channel-pruning/lib/net.py", line 7, in <module>
import caffe
File "/mnt/lustre/dutianyuan/channel-pruning/caffe/python/caffe/__init__.py", line 4, in <module>
from .proto.caffe_pb2 import TRAIN, TEST
File "/mnt/lustre/dutianyuan/channel-pruning/caffe/python/caffe/proto/caffe_pb2.py", line 799, in <module>
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\020\001')),
File "/home/dutianyuan/anaconda3/lib/python3.5/site-packages/google/protobuf/descriptor.py", line 869, in _ParseOptions
message.ParseFromString(string)
File "/home/dutianyuan/anaconda3/lib/python3.5/site-packages/google/protobuf/message.py", line 185, in ParseFromString
self.MergeFromString(serialized)
File "/home/dutianyuan/anaconda3/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 1093, in MergeFromString
raise message_mod.DecodeError('Truncated message.')
google.protobuf.message.DecodeError: Truncated message.
and when I change protobuf to 3.2.0 / 3.3.0 / 3.4.0, the error message is
Traceback (most recent call last):
File "train.py", line 19, in <module>
from lib.net import Net, load_layer, caffe_test
File "/mnt/lustre/dutianyuan/channel-pruning/lib/net.py", line 7, in <module>
import caffe
File "/mnt/lustre/dutianyuan/channel-pruning/caffe/python/caffe/__init__.py", line 4, in <module>
from .proto.caffe_pb2 import TRAIN, TEST
File "/mnt/lustre/dutianyuan/channel-pruning/caffe/python/caffe/proto/caffe_pb2.py", line 17, in <module>
serialized_pb='\n\x0b\x63\x61\x66\x66\x65.proto\x12\x05\x63\x61\x66\x66\x65\"\x1c\n\tBlobShape\x12\x0f\n\x03\x64im\x18\x01
.....with a lot of \x......
File "/home/dutianyuan/anaconda3/lib/python3.5/site-packages/google/protobuf/descriptor.py", line 824, in __new__
return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: expected bytes, str found
When I first met this problem, my Python version is 3.4 and your default setting is with Python 3.5. So I install Python3.5 and Python3.6 by Anaconda, Python 3.6 by apt-get. No matter what version is, the problem was still not solved.
Hope you can show me the specific version of your coding environment!
Thanks!
Hi,I am using your open source model faster-rcnn VGGx2 and VGGx4 code, the results did not achieve the effect of acceleration, your accuracy in the form is the actual accuracy of it? Why is it so much worse than the original VGG? Or I ignored what the details, look forward to your answer, thank you
I want to prune inception v1 , can channel pruning fit for it ?
All are welcome to create issues, but please google the problem first, and make sure it has not already been reported.
Operating system:
CUDA version:
CUDNN version:
openCV version:
BLAS:
Python version:
find: examples/FSRCNN/Train/91': No such file or directory find:
images': No such file or directory
pycaffe was compiled, it occured errors below,
python3 train.py -action c3 -gpu GPU0
no lighting pack
Traceback (most recent call last):
File "train.py", line 19, in
from lib.net import Net, load_layer, caffe_test
File "/home/yq/work/face_class/prune/cpc/channel-pruning/lib/net.py", line 7, in
import caffe
File "/home/yq/work/face_class/prune/cpc/channel-pruning/caffe/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/home/yq/work/face_class/prune/cpc/channel-pruning/caffe/python/caffe/pycaffe.py", line 13, in
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver,
ImportError: dynamic module does not define init function (PyInit__caffe)
@yihui-he in function c3() of train.py, this line(https://github.com/yihui-he/channel-pruning/blob/master/train.py#L73) of code : WPQ, new_pt = net.R3(), I can't find descriptions of WPQ in your paper, could you explain it?
HI.I'm sorry to bother you.When I run python train.py -action c3 -caffe 0 ,I got the error like this:
no lighting pack
[libprotobuf INFO google/protobuf/io/coded_stream.cc:610] Reading dangerously large protocol message. If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons. To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:81] The total number of bytes read was 553432081
Process Process-1:
Traceback (most recent call last):
File "/home/tang/anaconda3/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/home/tang/anaconda3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/tang/channel-pruning/lib/worker.py", line 21, in job
ret = target(**kwargs)
File "train.py", line 26, in step0
net = Net(pt, model=model, noTF=1)
File "/home/tang/channel-pruning/lib/net.py", line 67, in init
self.net_param = NetBuilder(pt=pt)
File "/home/tang/channel-pruning/lib/builder.py", line 131, in init
pb2.text_format.Merge(f.read(), self.net)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 476, in Merge
descriptor_pool=descriptor_pool)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 526, in MergeLines
return parser.MergeLines(lines, message)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 559, in MergeLines
self._ParseOrMerge(lines, message)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 574, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 675, in _MergeField
merger(tokenizer, message, field)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 764, in _MergeMessageField
self._MergeField(tokenizer, sub_message)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 675, in _MergeField
merger(tokenizer, message, field)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 764, in _MergeMessageField
self._MergeField(tokenizer, sub_message)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 675, in _MergeField
merger(tokenizer, message, field)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 809, in _MergeScalarField
value = tokenizer.ConsumeString()
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 1151, in ConsumeString
the_bytes = self.ConsumeByteString()
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 1166, in ConsumeByteString
the_list = [self._ConsumeSingleByteString()]
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_format.py", line 1191, in _ConsumeSingleByteString
result = text_encoding.CUnescape(text[1:-1])
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_encoding.py", line 103, in CUnescape
result = ''.join(_cescape_highbit_to_str[ord(c)] for c in result)
File "/home/tang/anaconda3/lib/python3.6/site-packages/protobuf-3.2.0-py3.6.egg/google/protobuf/text_encoding.py", line 103, in
result = ''.join(_cescape_highbit_to_str[ord(c)] for c in result)
IndexError: list index out of range
Can you show me what is the problem?
Thanks!
I found that there is a lot function names that are hard to tell which method it uses
for example
the "c3" in train.py which indicates these three methods
but which function implements these methods respectively?
Here is the list of function that I can't realize the corresponding method in papers
Would you explain these functions?
Thanks!
$ python3 train.py -action c3 -caffe 0
no lighting pack
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0828 09:45:42.791590 17829 image_data_layer.cpp:53] Check failed: !lines_.empty() File is empty
*** Check failure stack trace: ***
$ python3 train.py -action c3 -caffe GPU0
no lighting pack
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0828 09:46:49.385843 17904 common.cpp:152] Check failed: error == cudaSuccess (38 vs. 0) no CUDA-capable device is detected
*** Check failure stack trace: ***
how to do?
From the code, VGG16 acceleration factor can be 3X-4X, not only by using channel-pruning method but also used svd ? Is it true?
And What about the effect of ssd mobilenet ?
source: "path/to/ilsvrc12/sourceval.txt"
and
source: "path/to/ilsvrc12/sourcetrain.txt"
I noticed that there exist three steps in R3 function of net. The first one is VHDecompose, which is mentioned in paper as related work. The second one is itq_decompose, which I don't know, what it stands for? The third one is lasso pruning, as paper reported.
Am I right? Thank you.
@yihui-he
All are welcome to create issues, but please google the problem first, and make sure it has not already been reported.
make clean && make -j32 && make pycaffe -j32
Operating system: Ubuntu14.04
CUDA version: cuda-8.0
CUDNN version: 5.1
openCV version: 2.4.9
BLAS: mkl
Python version: python3.4
part error log:
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/ld: cannot find -lboost_python3
collect2: error: ld returned 1 exit status
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
Hi:
What's the difference between resnet50 and resnet 50 2X? Can you offer the original prototxt of resnet 50 2x? Thanks.
Thx for opening your impressive work.
In your paper, for 1-view, baseline 89.9%
of VGG16, is this result from the open caffemodel offered by VGG group?
it conflicted when implementing both make pycaffe with cmake .. && make, then it didn't work to import caffe.
Hi Yihui,
Nice work on channel pruning! I am wondering is there any plan to release some pruned models? It would be really great for fast test. : )
so so
This Pruning model cannot be downloaded. What's the reason.Thank you.
All are welcome to create issues, but please google the problem first, and make sure it has not already been reported.
Hi
I test the VGG-16 as follow command
caffe test -model channel_pruning_VGG-16_3C4x.prototxt -weights channel_pruning_VGG-16_3C4x.caffemodel -iterations 5000 -gpu 0
compare the performance of original vgg-16, I found that the memory of GPU is increased.
The test result of GPU memory consume in nvidia GTX1080:
channel_pruning_VGG-16_3C4x.caffemodel : 1773MB
original_VGG-16.caffemodel: 1503MB
ps: batch_size=10
why does it increase so much?
Is that normal?
Operating system: ubuntu16.04
CUDA version: 8.0
CUDNN version: 6.0
openCV version: 2.4.9
BLAS:
Python version: 3.5
File "train.py", line 19, in
from lib.net import Net, load_layer, caffe_test
File "/home/yq/work/face_class/prune/cpc/channel-pruning/lib/net.py", line 7, in
import caffe
File "/home/yq/work/face_class/prune/channel-pruning-master/caffe/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/home/yq/work/face_class/prune/channel-pruning-master/caffe/python/caffe/pycaffe.py", line 13, in
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver,
ImportError: /home/yq/work/face_class/prune/channel-pruning-master/caffe/python/caffe/../../build/lib/libcaffe.so.1.0.0-rc5: undefined symbol: _ZN2cv6imreadERKNS_6StringEi
can you share your cfgs for resnet file ?
In '''channel pruning'''
, dictionary_kernels()
gives the result of the feature map selection (i.e. indices, weights and bias):
https://github.com/yihui-he/channel-pruning/blob/c18d5ae4f8dd895e22d89a388f13630d1220876a/lib/net.py#L1440-L1445
As you know, using the indices(idxs
), the values of W2
that aren't selected are set to zero , while the selected are over-written with W2.copy()
(W2
* shape remains the same)*.
But in case of W1
, un-selected filters are completely vanished from the WPQ dictionary:
https://github.com/yihui-he/channel-pruning/blob/c18d5ae4f8dd895e22d89a388f13630d1220876a/lib/net.py#L1452-L1454
Why? I'm assuming that it is OK because in the next iteration convnext
will be labeled as conv
, and the weights that were set as zero will be selected by the lasso regression to be removed (so it takes 2 iterations to vanish a set of filter). Am I correct?
Hi, could you please tell me the ITQ's full name? I'm not good at math, I searched it in the Internet, but there were nothing. I saw only LASSO in your paper, but SVD, "ITQ" and LASSO in your code, which one makes more contribution? Hope to get your reply, thanks!
The pre-model channel_pruning_VGG-16_3C4x is slowly on GPU platform
can you share your 2.5X on GPU?
caffe test -model ****.prototxt -weights ****.caffemodel -iterations 5 -gpu GPU0
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injectorboost::bad_lexical_cast >'
what(): bad lexical cast: source type value could not be interpreted as target
*** Aborted at 1503819237 (unix time) try "date -d @1503819237" if you are using GNU date ***
PC: @ 0x7f477dd6e1c7 gsignal
*** SIGABRT (@0x3ea00005f02) received by PID 24322 (TID 0x7f477fe20740) from PID 24322; stack trace: ***
@ 0x7f477dd6e250 (unknown)
@ 0x7f477dd6e1c7 gsignal
@ 0x7f477dd6fe2a abort
@ 0x7f477e3a9b7d __gnu_cxx::__verbose_terminate_handler()
@ 0x7f477e3a79c6 (unknown)
@ 0x7f477e3a7a11 std::terminate()
@ 0x7f477e3a7c29 __cxa_throw
@ 0x410154 boost::throw_exception<>()
@ 0x409612 get_gpus()
@ 0x40a29d test()
@ 0x4084e0 main
@ 0x7f477dd59ac0 __libc_start_main
@ 0x408d09 _start
@ 0x0 (unknown)
Aborted (core dumped)
only one GPU, so it was shut to NCCL multi GPUs, error as following:
Makefile:631: recipe for target '.build_release/examples/mnist/convert_mnist_data.bin' failed
make: *** [.build_release/examples/mnist/convert_mnist_data.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to ncclGetUniqueId' .build_release/lib/libcaffe.so: undefined reference to
ncclBcast'
.build_release/lib/libcaffe.so: undefined reference to ncclAllReduce' .build_release/lib/libcaffe.so: undefined reference to
ncclCommInitRank'
.build_release/lib/libcaffe.so: undefined reference to ncclCommDestroy' .build_release/lib/libcaffe.so: undefined reference to
ncclCommInitAll'
.build_release/lib/libcaffe.so: undefined reference to `ncclGetErrorString'
collect2: error: ld returned 1 exit status
Makefile:626: recipe for target '.build_release/tools/extract_features.bin' failed
make: *** [.build_release/tools/extract_features.bin] Error 1
The reference paper[53]:
there exists a nonuniform result
asym. (3d) model give (3.0×) GPU accelerate in Tabel 8
but it show 0.96X GPU accelerate in your paper in Tabel 3
why is so big different?
This pruning models cannot be downloaded.what's the reason? Thank you
As mentioned in the title.
I guess that the more is the number of layer, the more is better in speed after pruning.
I've been studying the code you kindly posted, but I'm still unsure on how to set the speed-up factor for the layers, or is it possible to set a specific speed-up factor for the pruning to modify each layer differently. Could you please provide so indications on how to achieve this?
All are welcome to create issues, but please google the problem first, and make sure it has not already been reported.
Operating system: ubuntu 14.04
CUDA version: 8.0
CUDNN version: 5.1
openCV version: 3.1
BLAS:
Python version: 2.7
Who can explain what's the meaning of ITQ_decompose function? I can't understand what to do and what to return in this function.
Hi,thanks for your codes,When I adopt the following configuration, encounter the following error in make test:
Operating system: linux
CUDA version: 8.0
CUDNN version: cudnn-8.0-linux-x64-v5.0
openCV version: 3.0
BLAS: yes
Python version: 3.4
the error is:
src/caffe/test/test_filter_layer.cpp:20:3: error: Uninitialized members‘caffe::FilterLayerTest<caffe::CPUDevice >::blob_top_labels_’Has a 'const' type‘ caffe::Blob* const’ [-fpermissive];
I have no idea how to solver this problom,thanks for your help.
https://github.com/yihui-he/channel-pruning/blob/master/lib/net.py#L1301
The rankdic is set beforehand and it looks like only for VGG16.
it seems that any formula or theorem about calculating rankdic does not mention in paper.
is it the experimental outcome?
if true, what's the rank for ResNet-50?
Since the rankdic in the release source code of ResNet-50 is same as VGG16
https://github.com/yihui-he/channel-pruning/releases/tag/ResNet-50-2X
thanks.
first, I really appreciated for your help!
Then I have some quesqions
How can i set single channel pruning?
how much is channel prunning accerate ration ?
why channel_pruning_VGG-16_3C4x.caffemodel is so big ?
e.g., your resnet prototxt : ResNet-50 | 2X | 90.8 (Top-5), it sounded impossible.
Due to the structure constraints of ResNet-50, non-tensor layers (e.g., batch normalization and pooling layers) take up more than 40% of the inference time on GPU.
fg: F(x) = f(x)+x f(x) in residual module.
I'm reimplementing the paper, confused about the speedup setting. The paper compares different methods under different speedup settings like "2x, 4x, 5x". I'm curious about how to calculate that.
GFLOPs of all conv layers before prune / GFLOPs of all conv layers after prune = 2
, is this correct?VGG-16 3C4x
and channel pruning 5X
. Here is the result:VGG-16 3C4x
is 3.7440channel pruning 5X
is 3.391715.3466/3.7440=4.1
(verified as 4x) and 15.3466/3.3917=4.5
. The latter 4.5
is close to 5x
, basically verified. So is my understanding exactly what the authors mean?hello, i have no idea what is wrong. thanks in advance
done:
git clone --recursive https://github.com/yihui-he/channel-pruning.git
make -j8 && make pycaffe
fail:
python3 train.py -action c3 -caffe 0
stdout:
no lighting pack
Failed to include caffe_pb2, things might go wrong!
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1069, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1091, in InternalParse
(tag_bytes, new_pos) = local_ReadTag(buffer, pos)
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/decoder.py", line 181, in ReadTag
while six.indexbytes(buffer, pos) & 0x80:
TypeError: unsupported operand type(s) for &: 'str' and 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 19, in
from lib.net import Net, load_layer, caffe_test
File "/home/t-jinche/channel-pruning/lib/net.py", line 7, in
import caffe
File "/home/t-jinche/channel-pruning/caffe/python/caffe/init.py", line 4, in
from .proto.caffe_pb2 import TRAIN, TEST
File "/home/t-jinche/channel-pruning/caffe/python/caffe/proto/caffe_pb2.py", line 799, in
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\020\001')),
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/descriptor.py", line 874, in _ParseOptions
message.ParseFromString(string)
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/message.py", line 185, in ParseFromString
self.MergeFromString(serialized)
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1075, in MergeFromString
raise message_mod.DecodeError('Truncated message.')
google.protobuf.message.DecodeError: Truncated message.
Thanks again for sharing your code and releasing the VGG-16 5X pruned caffemodel. May I ask how much should the code be changed in order to produce this model (pruning only, no 3C included) ?
Can this be done by simply passing a different flag instead of "-action c3"? Thanks!!!! And sorry for asking but I'm sure a lot of people will want to know about this.
Hi,When I run the python3 train.py -action c3 -caffe GPU0,I encounted the following error:
/usr/local/lib/python3.4/dist-packages/matplotlib/backends/backend_gtk3agg.py:18: UserWarning: The Gtk3Agg backend is known to not work on Python 3.x with pycairo. Try installing cairocffi.
"The Gtk3Agg backend is known to not work on Python 3.x with pycairo. "
no lighting pack
Failed to include caffe_pb2, things might go wrong!
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1062, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1084, in InternalParse
(tag_bytes, new_pos) = local_ReadTag(buffer, pos)
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/decoder.py", line 181, in ReadTag
while six.indexbytes(buffer, pos) & 0x80:
TypeError: unsupported operand type(s) for &: 'str' and 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 19, in
from lib.net import Net, load_layer, caffe_test
File "/home/dl/file/lxw/channel_pruning/channel-pruning-master/lib/net.py", line 7, in
import caffe
File "/home/dl/file/lxw/channel_pruning/channel-pruning-master/caffe/python/caffe/init.py", line 4, in
from .proto.caffe_pb2 import TRAIN, TEST
File "/home/dl/file/lxw/channel_pruning/channel-pruning-master/caffe/python/caffe/proto/caffe_pb2.py", line 799, in
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\020\001')),
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/descriptor.py", line 869, in _ParseOptions
message.ParseFromString(string)
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/message.py", line 185, in ParseFromString
self.MergeFromString(serialized)
File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1068, in MergeFromString
raise message_mod.DecodeError('Truncated message.')
google.protobuf.message.DecodeError: Truncated message.
I have no idea how to solver this problems,Thanks for your help!
Hi, may you upload the resource problem, the network the speed is not good and the model download fails, can you provide the model Baidu cloud download link? thanks for your help.
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.