Hello everybody,
I have a problem of loading a pretrained model from Caffe Net. I'm using macOS Sierra 10.12.1 on Macbook Pro ME865 without an Nvidia GPU. Thus, in my code, there is a code like:
I downloaded the following files and put them to the same folder of my source code:
- face_full_conv2.prototxt
- alexNet__iter_60000.caffemodel
I implemented the following Python code:
net_full_conv = caffe.Net('face_full_conv2.prototxt', caffe.TEST)
And here is the error I got:
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1221 04:30:05.741330 3992683456 upgrade_proto.cpp:67]
Traceback (most recent call last):
File "/Users/macpro/Google Drive/MyProject/main.py", line 267, in <module>
main()
File "/Users/macpro/Google Drive/MyProject/main.py", line 262, in main
face_detection('test.txt')
File "/Users/macpro/Google Drive/MyProject/main.py", line 218, in face_detection
net_full_conv = caffe.Net('face_full_conv2.prototxt', caffe.TEST)
RuntimeError: ios_base::clear: unspecified iostream_category error
I also tried loading the parameter and its weights simultaneously:
net_full_conv = caffe.Net('face_full_conv2.prototxt', 'alexNet__iter_60000.caffemodel', caffe.TEST)
And the error is the same as above.
Here is a brief significant steps' description about how did I install Caffe.
[100%] Linking CXX executable ../../../test/test.testbin
[100%] Built target test.testbin
Scanning dependencies of target runtest
test.testbin(97882,0x7fffedfb83c0) malloc: *** malloc_zone_unregister() failed for 0x7fffedfae000
Note: Google Test filter = -*GPU*
Note: Randomizing tests' orders with a seed of 30769 .
[==========] Running 1098 tests from 150 test cases.
[----------] Global test environment set-up.
[----------] 1 test from UniformFillerTest/1, where TypeParam = d
[ RUN ] UniformFillerTest/1.TestFill
[ OK ] UniformFillerTest/1.TestFill (6 ms)
[----------] 1 test from UniformFillerTest/1 (6 ms total)
[----------] 12 tests from NesterovSolverTest/1, where TypeParam = N5caffe9CPUDeviceIdEE
[ RUN ] NesterovSolverTest/1.TestNesterovLeastSquaresUpdateWithWeightDecay
*** Aborted at 1482216043 (unix time) try "date -d @1482216043" if you are using GNU date ***
PC: @ 0x7fffe3e6ed28 std::__1::__shared_count::__add_shared()
*** SIGSEGV (@0x8) received by PID 97882 (TID 0x7fffedfb83c0) stack trace: ***
@ 0x7fffe54a5bba _sigtramp
@ 0x11096979a caffe::(anonymous namespace)::protobuf_AssignDescriptors_once_
@ 0x7fffe3e3c9fc std::__1::ios_base::getloc()
@ 0x110827d28 caffe::Solver<>::Init()
@ 0x110827afe caffe::Solver<>::Solver()
@ 0x1100cc378 caffe::SGDSolver<>::SGDSolver()
@ 0x1100d5b68 caffe::NesterovSolverTest<>::InitSolver()
@ 0x1100c7334 caffe::GradientBasedSolverTest<>::InitSolverFromProtoString()
@ 0x1100c7e61 caffe::GradientBasedSolverTest<>::RunLeastSquaresSolver()
@ 0x1100c7742 caffe::GradientBasedSolverTest<>::TestLeastSquaresUpdate()
@ 0x11028cb1a testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x11028c97a testing::Test::Run()
@ 0x11028dbb2 testing::TestInfo::Run()
@ 0x11028e4a3 testing::TestCase::Run()
@ 0x1102947b9 testing::internal::UnitTestImpl::RunAllTests()
@ 0x110294293 testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x1102941e9 testing::UnitTest::Run()
@ 0x110010705 main
@ 0x7fffe5298255 start
@ 0x3 (unknown)
/bin/sh: line 1: 97882 Segmentation fault: 11 "/Users/macpro/Caffe/build/test/test.testbin" --gtest_shuffle --gtest_filter="-*GPU*"
make[3]: *** [src/caffe/test/CMakeFiles/runtest] Error 139
make[2]: *** [src/caffe/test/CMakeFiles/runtest.dir/all] Error 2
make[1]: *** [src/caffe/test/CMakeFiles/runtest.dir/rule] Error 2
make: *** [runtest] Error 2
=> I avoid this issue because when I search Google for the answer, somebody said that this error does not affect the completion of the Caffe installation.
I also tried installing without LevelDB (set USE_LEVELDB to OFF in CMakeLists.txt). The error is still the same, except that it avoid the problem of "malloc_zone_unregister()" as you can see at the above installation error.
Furthermore, I tried with C++ implementation. The error is still the same. I use CLion as the IDE. The step of including Caffe has no problem, but the problem was raised with the following code:
Net<float> caffe_test_net("./face_full_conv.prototxt", caffe::TEST);
There is no error message, but when I debug, the error was shown as follows:
Can anyone help me to solve this problem?