mathmanu / caffe-jacinto

This repository has moved. The new link can be obtained from https://github.com/TexasInstruments/jacinto-ai-devkit
116 stars 35 forks source link

compatibility with caffe #8

Open Wronskia opened 6 years ago

Wronskia commented 6 years ago

Hello manu,

I tried to use a snapshot of a sparsified model from caffe-jacinto and to load it in caffe. However, I get an error stating that there is not enough weights and after checking the size of the 50% sparsified model I found that its half size of the original caffemodel. Would it be possible to have compatibility?

Thanks, Best

mathmanu commented 6 years ago

Hi,

I am not sure which model. Can you please share the path of the original and the sparse model.

Thanks,

Wronskia commented 6 years ago

Hi,

Here is the sparse caffemodel : https://drive.google.com/file/d/0B64fJzg3TzZwSm9HeHNlT0hXSEk/view Actually, I retrained googlenet with a subsample of imagenet with sparsity : you can download the original here : https://github.com/BVLC/caffe/tree/master/models/bvlc_googlenet

thanks, best

mathmanu commented 6 years ago

There should not be any size different between the original model and the sparse model. In the sparse model, several coefficients are zero - that is all.

For example check the sizes of these models:

https://github.com/tidsp/caffe-jacinto-models/tree/caffe-0.16/trained/image_segmentation/cityscapes5_jsegnet21v2/initial

https://github.com/tidsp/caffe-jacinto-models/tree/caffe-0.16/trained/image_segmentation/cityscapes5_jsegnet21v2/sparse

Are you using float16 anywhere in your model while training?

Wronskia commented 6 years ago

Yes I agree there should not be any difference. here is my training log train.log

I am not using any quantization

Wronskia commented 6 years ago

and the prototxt I am using googlenet_deploy.prototxt.docx

The thing is when I run in caffe-jacinto an inference using this _iter_8000.caffemodel which is half the size of the original, I get the correct results

mathmanu commented 6 years ago

Hi,

Your first post said: I tried to use a snapshot of a sparsified model from caffe-jacinto and to load it in caffe. However, I get an error

Your last post said: The thing is when I run in caffe-jacinto an inference using this _iter_8000.caffemodel which is half the size of the original, I get the correct results

Please note that caffe-jacinto is derived from NVIDIA/caffe which has differed from BVLC /caffe quite a bit. I am not sure if NVIDIA/caffe model can be loaded in BVLC/caffe.

What did you mean by caffe in your first post? Is it NVIDIA/caffe or BVLC/caffe?

Wronskia commented 6 years ago

Hi,

I meant BVLC/caffe

mathmanu commented 6 years ago

Okay.

Can you try one thing? - train the model in NVIDIA/caffe and check the size. Also see if it can be loaded in BVLC caffe. If not, then you can file an issue in NVIDIA/caffe.

Wronskia commented 6 years ago

you are right. The same thing happened in NVcaffe

Thanks

mathmanu commented 6 years ago

Try filing an issue in NVIDIA/caffe. They might be able to help.

mathmanu commented 6 years ago

Have you seen this? https://github.com/NVIDIA/caffe/issues/436

I also noticed the issue that you filed: https://github.com/NVIDIA/caffe/issues/439

These two seem related.

Wronskia commented 6 years ago

Yes thank you manu