Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mnn/mnn-0.2.0.3/tools/converter/source/caffe/Convolution.cpp:30: Check failed: weightBlob.shape().dim_size() == 4 ==> Conv Weight Dimension ERROR! #215

Closed
ghimiredhikura opened this issue Aug 4, 2019 · 9 comments

Comments

@ghimiredhikura
Copy link

Hi,

I am having trouble converting standard cnn architecture models such as alexnet, vgg16, googlenet etc. Following is the error log.

~mnn-0.2.0.3/tools/converter/build # ./MNNConvert -f CAFFE --modelFile googlenet.caffemodel --prototxt googlenet.prototxt --benchmarkModel --MNNModel test.mnn --bizCode MNN

MNNConverter Version: 0.0.0.1 - MNN @ 2018

Start to Convert Other Model Format To MNN Model...
terminate called after throwing an instance of 'Error'
  what():  [02:44:23] /home/~/mnn-0.2.0.3/tools/converter/source/caffe/Convolution.cpp:30: Check failed: weightBlob.shape().dim_size() == 4 ==> Conv Weight Dimension ERROR!
Aborted

Please help.

Thanks.

Best,
Deepak

@czy2014hust
Copy link
Collaborator

Maybe your caffe model use the old caffe proto. Please give us the model link, and we test on it.

@ghimiredhikura
Copy link
Author

These are the models that I have trouble testing: alexnet, resnet50, vgg16

Thanks.

@czy2014hust
Copy link
Collaborator

【Converted Done!】

@17759205390
Copy link

【Converted Done!】

@czy2014hust
你好,可以给我你的钉钉账号吗,想请教你个问题哈

@ghimiredhikura
Copy link
Author

@czy2014hust,

Thanks for quick check. So you can convert without any error?
I am using raspberrypi 3b+, how about you?

@czy2014hust
Copy link
Collaborator

@czy2014hust,

Thanks for quick check. So you can convert without any error?
I am using raspberrypi 3b+, how about you?

Yes, I test on resnet50 which you provide without any error.
I think this error has nothing to do with platform.

@czy2014hust
Copy link
Collaborator

【Converted Done!】

@czy2014hust
你好,可以给我你的钉钉账号吗,想请教你个问题哈

可以在Github MNN钉钉群里说

@ghimiredhikura
Copy link
Author

Thanks. I will try again.

@li-qing li-qing closed this as completed Aug 13, 2019
@JackChen101
Copy link

JackChen101 commented Mar 25, 2020

这个问题的原因是caffe仓库中提供的alexnet模型是旧版本的模型,需要用caffe的更新工具upgrade_net_proto_binary进行更新。
请按以下步骤操作:
1、下载并编译caffe源码,得到模型更新工具

git clone https://github.com/BVLC/caffe.git
cd caffe && mkdir build && cd build
cmake -DCPU_ONLY=ON -DBUILD_python=OFF -DBUILD_python_layer=OFF -DUSE_OPENCV=OFF -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF ..
make -j$(nproc)

编译完成后在tools目录下会生成upgrade_net_proto_binary和upgrade_net_proto_text等文件。
2、更新模型

./upgrade_net_proto_binary ../../../MNN/build_ubuntu/bvlc_alexnet.caffemodel ./bvlc_alexnet_upgrade.caffemodel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants