Reload weights into fc layer after compression

15 views
Skip to first unread message

pius kwao

unread,
Aug 14, 2017, 11:53:29 PM8/14/17
to Caffe Users
Hi,
    I am trying to store weights in a the fc layers in a compressed sparse row format. When I retrieve the weights and convert them to csr matrix format , it's size in memory 
reduces drastically but when I load it back into caffe my model size remains the same. Basically this is what I'm doing:

                                                             temp2 = net.params['ip1'][0].data.shape
                                                             sparse_csr1 = sparse.scr_matrix(temp2, shape)
                                                             net.params['ip1'][0].data[...] = sparse_csr1
                                                             net.save('compressed.caffemodel')
Any suggestions will be appreciated

Reply all
Reply to author
Forward
0 new messages