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

upgrade_net_proto_binary segfaults #3750

Closed
dieterichlawson opened this issue Feb 29, 2016 · 5 comments
Closed

upgrade_net_proto_binary segfaults #3750

dieterichlawson opened this issue Feb 29, 2016 · 5 comments
Labels

Comments

@dieterichlawson
Copy link

upgrade_net_proto_binary segfaults when upgrading certain caffemodel files.

Steps to reproduce:

  1. Download VGG16 from model zoo
  2. run tools/upgrade_net_proto_binary VGG_ILSVRC_16_layers.caffemodel vgg16.caffemodel
  3. It segfaults, giving the following stacktrace in gdb.
libdc1394 error: Failed to initialize libdc1394
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:505] 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:78] The total number of bytes read was 553432081
[libprotobuf FATAL /usr/include/google/protobuf/repeated_field.h:613] CHECK failed: (index) < (size()):
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: (index) < (size()):

Program received signal SIGABRT, Aborted.
0x00007ffff63b1cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff63b1cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff63b50d8 in __GI_abort () at abort.c:89
#2  0x00007ffff69b6535 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff69b46d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff69b4703 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff69b4922 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff0af7b58 in google::protobuf::internal::LogMessage::Finish() ()
   from /usr/lib/x86_64-linux-gnu/libprotobuf.so.8
#7  0x00007ffff738bbe9 in google::protobuf::RepeatedField<int>::Get (this=0x7fffffffe9a8, index=0)
    at /usr/include/google/protobuf/repeated_field.h:613
#8  0x00007ffff737b4be in caffe::NetParameter::input_dim (this=0x7fffffffe960, index=0)
    at .build_debug/src/caffe/proto/caffe.pb.h:10930
#9  0x00007ffff73d9c43 in caffe::UpgradeNetInput (net_param=0x7fffffffe960)
    at src/caffe/util/upgrade_proto.cpp:971
#10 0x00007ffff73d5561 in caffe::UpgradeNetAsNeeded (param_file=..., param=0x7fffffffe960)
    at src/caffe/util/upgrade_proto.cpp:67
#11 0x0000000000401936 in main (argc=3, argv=0x7fffffffeaf8) at tools/upgrade_net_proto_binary.cpp:36

This was tested with most recent master.

@shelhamer shelhamer added the bug label Feb 29, 2016
@dieterichlawson
Copy link
Author

This also happens when I try to load resnet in pycaffe:

>> import caffe
libdc1394 error: Failed to initialize libdc1394
>>> net = caffe.Net("resnet50_deploy.prototxt","resnet50.caffemodel",caffe.TEST)
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0229 22:39:25.116803 17707 upgrade_proto.cpp:65] Attempting to upgrade input file specified using deprecated input fields: resnet50_deploy.prototxt
I0229 22:39:25.116905 17707 upgrade_proto.cpp:68] Successfully upgraded file specified using deprecated input fields.
W0229 22:39:25.116946 17707 upgrade_proto.cpp:70] Note that future Caffe releases will only support input layers and not input fields.
...
I0229 22:39:25.613426 17707 net.cpp:274] Network initialization done.
I0229 22:39:25.805191 17707 upgrade_proto.cpp:65] Attempting to upgrade input file specified using deprecated input fields: resnet50.caffemodel
Segmentation fault (core dumped)

@shelhamer
Copy link
Member

I've confirmed this with master on Ubuntu 15.04 and suspect I somehow messed this up in #3211. Everything does work as expected prior to that PR. Will investigate.

@dieterichlawson
Copy link
Author

FYI I checked out fe0f441 (the latest commit before the changes to input layers) and was able to load resnet without issue in pycaffe. Thanks for the prompt response!

shelhamer added a commit to shelhamer/caffe that referenced this issue Feb 29, 2016
The caffemodel does not need input conversion and attempting to convert
causes a crash.

Fix BVLC#3750
@shelhamer
Copy link
Member

@dieterichlawson check out #3751 to confirm the fix.

zouxiaochuan pushed a commit to zouxiaochuan/caffe that referenced this issue Mar 17, 2016
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
SvenTwo pushed a commit to SvenTwo/caffe that referenced this issue Apr 6, 2016
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
fxbit pushed a commit to Yodigram/caffe that referenced this issue Sep 1, 2016
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
zouxiaochuan pushed a commit to zouxiaochuan/caffe that referenced this issue Oct 24, 2016
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
zouxiaochuan pushed a commit to zouxiaochuan/caffe that referenced this issue Oct 24, 2016
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
zouxiaochuan pushed a commit to zouxiaochuan/caffe that referenced this issue Feb 15, 2017
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
zouxiaochuan pushed a commit to zouxiaochuan/caffe that referenced this issue Feb 15, 2017
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
zouxiaochuan pushed a commit to zouxiaochuan/caffe that referenced this issue Feb 15, 2017
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
zouxiaochuan pushed a commit to zouxiaochuan/caffe that referenced this issue Feb 15, 2017
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
acmiyaguchi pushed a commit to acmiyaguchi/caffe that referenced this issue Nov 13, 2017
convert inputs in legacy definitions (prototxt), but simply strip inputs
from legacy weights (caffemodel).

fix BVLC#3750
@wangxinyue11
Copy link

Have you solved it? I have encountered the same problem as you.

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

No branches or pull requests

3 participants