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

转caffe模型core dump #404

Closed
kuov opened this issue Oct 22, 2019 · 3 comments
Closed

转caffe模型core dump #404

kuov opened this issue Oct 22, 2019 · 3 comments

Comments

@kuov
Copy link

kuov commented Oct 22, 2019

模型有点儿大170多M,是resnet50的,转的时候core dump了,gdb信息如下
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff6516801 in __GI_abort () at abort.c:79
#2 0x00007ffff6b6b957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff6b71ab6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff6b71af1 in std::terminate() ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff6b71d24 in __cxa_throw ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff6b7229c in operator new(unsigned long) ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00007ffff6c03bc7 in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_assign(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007ffff77fbb15 in caffe2MNNNet(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::unique_ptr<MNN::NetT, std::default_deleteMNN::NetT >&) ()
from /home/cccp/mnt/CUIT/MNN-0.2.1.0/tools/converter/build/source/caffe/libcaffe.so
#9 0x000055555556af1c in main ()

最新的版本也会报这个错

@kuov
Copy link
Author

kuov commented Oct 22, 2019

崩溃的地方是在 如下代码处:
for (int l = 0; l < caffeProtxt.layer_size(); ++l) {
MNN::OpT* op = new MNN::OpT;
auto& layer = caffeProtxt.layer(l);
op->name = layer.name();
// Input Output
for (int t = 0; t < layer.top_size(); ++t) {
op->outputIndexes.emplace_back(tensorName.find(layer.top(t))->second);
}
LG<<"caffe2MNNNet7:1";
for (int t = 0; t < layer.bottom_size(); ++t) {
op->inputIndexes.emplace_back(tensorName.find(layer.bottom(t))->second);
}
LG<<"caffe2MNNNet7:2";
auto creator = OpConverterSuit::get()->search(layer.type());
if (nullptr == creator) {
LG << "Don't support type [ " << layer.type().c_str() << " ], for " << layer.name().c_str();
delete op;
break;
}
const caffe::LayerParameter* layerP = nullptr;
for (int v = 0; v < caffeModel.layer_size(); ++v) {
auto& l = caffeModel.layer(v);
if (l.name() == layer.name()) {
layerP = &l;
break;
}
}
if (NULL == layerP) {
layerP = &layer;
}
op->type = creator->opType();
op->main.type = creator->type();

    creator->run(op, layer, *layerP);
    LG<<"caffe2MNNNet7:3";
    netT->oplists.emplace_back(op);
}

@nullian
Copy link

nullian commented Oct 28, 2019

转caffe模型 直接崩溃了

gdb --args ./MNNConvert -f CAFFE --prototxt squeezenet_v1.1.caffe.prototxt --modelFile squeezenet_v1.1.caffe.caffemodel --MNNModel squeezenet_v1.1.caffe.mnn --bizCode biz
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./MNNConvert...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/yuanhao/osc/MNN-master/tools/converter/build/MNNConvert -f CAFFE --prototxt squeezenet_v1.1.caffe.prototxt --modelFile squeezenet_v1.1.caffe.caffemodel --MNNModel squeezenet_v1.1.caffe.mnn --bizCode biz
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

MNNConverter Version: 0.0.0.1 - MNN @ 2018

Start to Convert Other Model Format To MNN Model...

Program received signal SIGSEGV, Segmentation fault.
__memcpy_avx_unaligned ()
at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:244
244 ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S: No such file or directory.
(gdb) bt
#0 __memcpy_avx_unaligned ()
at ../sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S:244
#1 0x00007ffff6c183c2 in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_assign(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2 0x00007ffff7808a70 in caffe2MNNNet(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::unique_ptr<MNN::NetT, std::default_deleteMNN::NetT >&) ()
from /home/yuanhao/osc/MNN-master/tools/converter/build/source/caffe/libcaffe.so
#3 0x00000000004142dc in main ()

@nullian
Copy link

nullian commented Oct 28, 2019

我这里是有两个问题
1.没有链接 pthread
2.使用了resource目录下的模型

修改了之后可以了

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

3 participants