3D-Caffe icon indicating copy to clipboard operation
3D-Caffe copied to clipboard

some error on compiling

Open JianKang1216 opened this issue 8 years ago • 30 comments

Hello, faustomilletari

This is Jian Kang. I am very interested in your work 3D-caffe. So I tried to compile your 3D-Caffe, but I encountered a problem when I make runtest. it seems that something's wrong on softmax definition(dimension). Could you help me to fix it? The problem is as below. Thank you very much.

Best wishes, Jian Kang

make -j all: src/caffe/layers/softmax_loss_layer.cpp: In instantiation of ‘void caffe::SoftmaxWithLossLayer<Dtype>::Forward_cpu(const std::vectorcaffe::Blob<Dtype_>&, const std::vectorcaffe::Blob<Dtype_>&) [with Dtype = float]’: src/caffe/layers/softmax_loss_layer.cpp:138:1: required from here src/caffe/layers/softmax_loss_layer.cpp:60:16: warning: unused variable ‘weight’ [-Wunused-variable] const Dtype* weight = bottom[2]->cpu_data(); src/caffe/layers/softmax_loss_layer.cpp: In instantiation of ‘void caffe::SoftmaxWithLossLayer<Dtype>::Forward_cpu(const std::vectorcaffe::Blob<Dtype_>&, const std::vectorcaffe::Blob<Dtype_>&) [with Dtype = double]’: src/caffe/layers/softmax_loss_layer.cpp:138:1: required from here src/caffe/layers/softmax_loss_layer.cpp:60:16: warning: unused variable ‘weight’ [-Wunused-variable]

make runtest: 22 tests from NetTest/0, where TypeParam = caffe::CPUDevice [ RUN ] NetTest/0.TestGetLayerByName F0912 05:07:01.832667 3518 layer.hpp:343] Check failed: ExactNumBottomBlobs() == bottom.size() (3 vs. 2) SoftmaxWithLoss Layer takes 3 bottom blob(s) as input. *** Check failure stack trace: *** @ 0x2aca2464ddaa (unknown) @ 0x2aca2464dce4 (unknown) @ 0x2aca2464d6e6 (unknown) @ 0x2aca24650687 (unknown) @ 0x461059 caffe::Layer<>::CheckBlobCounts() @ 0x2aca25f71fd4 caffe::Net<>::Init() @ 0x2aca25f73d62 caffe::Net<>::Net() @ 0x575099 caffe::NetTest<>::InitNetFromProtoString() @ 0x5328bc caffe::NetTest<>::InitTinyNet() @ 0x56f4ba caffe::NetTest_TestGetLayerByName_Test<>::TestBody() @ 0x890b23 testing::internal::HandleExceptionsInMethodIfSupported<>() @ 0x887767 testing::Test::Run() @ 0x88780e testing::TestInfo::Run() @ 0x887915 testing::TestCase::Run() @ 0x88ac58 testing::internal::UnitTestImpl::RunAllTests() @ 0x88aee7 testing::UnitTest::Run() @ 0x4514fa main @ 0x2aca26e0af45 (unknown) @ 0x457b59 (unknown) @ (nil) (unknown) make: *** [runtest] Aborted (core dumped)

JianKang1216 avatar Sep 13 '16 00:09 JianKang1216

Same issue, any luck solving it?

luiscarm9 avatar Nov 07 '16 16:11 luiscarm9

I think it was because you are not using cudnn.

Fausto Milletarì Sent from my iPhone

On 7 Nov 2016, at 11:39, Luis Carlos Rivera [email protected] wrote:

Same issue, any luck solving it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Nov 07 '16 16:11 faustomilletari

I am using cudnn but still get the same error, after running make all I get this issue seleccion_062

luiscarm9 avatar Nov 07 '16 17:11 luiscarm9

I met the same issue, anyone solved it?

FayeYe avatar Nov 14 '16 14:11 FayeYe

could you please copy and paste here the full output and error message?

On Nov 14, 2016, at 9:09 AM, FayeYe [email protected] wrote:

I met the same issue, anyone solved it?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/3D-Caffe/issues/1#issuecomment-260343817, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsvo-yFAsCQgwZYvq4966JLiiT8Qm6ks5q-GuegaJpZM4J7KPk.

faustomilletari avatar Nov 14 '16 15:11 faustomilletari

Which version of cuDNN are you using? there have been some method signature changes between v3 and v4.

whatnick avatar Nov 15 '16 04:11 whatnick

I use > v4

Fausto Milletarì Sent from my iPhone

On 14 Nov 2016, at 23:57, Tisham Dhar [email protected] wrote:

Which version of cuDNN are you using? there have been some method signature changes between v3 and v4.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Nov 15 '16 05:11 faustomilletari

This is the part of the make all output src/caffe/layers/softmax_loss_layer.cpp: In instantiation of ‘void caffe::SoftmaxWithLossLayer<Dtype>::Forward_cpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = float]’: src/caffe/layers/softmax_loss_layer.cpp:138:1: required from here src/caffe/layers/softmax_loss_layer.cpp:60:16: warning: unused variable ‘weight’ [-Wunused-variable] const Dtype* weight = bottom[2]->cpu_data(); ^ src/caffe/layers/softmax_loss_layer.cpp: In instantiation of ‘void caffe::SoftmaxWithLossLayer<Dtype>::Forward_cpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = double]’: src/caffe/layers/softmax_loss_layer.cpp:138:1: required from here src/caffe/layers/softmax_loss_layer.cpp:60:16: warning: unused variable ‘weight’ [-Wunused-variable] CXX src/caffe/solver.cpp

luiscarm9 avatar Nov 15 '16 19:11 luiscarm9

I can run it, verify that you had added the pythonpath of cudnn. I'm using cudnn v5

luiscarm9 avatar Nov 19 '16 18:11 luiscarm9

error Thanks for your reply! When I run make all ,it will output this warning. Ignoring the warning, I can run it.

FayeYe avatar Nov 21 '16 06:11 FayeYe

Please feel free to edit the code to get rid of the warning

Fausto Milletarì Sent from my iPhone

On 21 Nov 2016, at 07:32, FayeYe [email protected] wrote:

Thanks for your reply! When I run make all ,it will output this warning. Ignoring the warning, I can run it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Nov 21 '16 15:11 faustomilletari

Met the same problem when "make runtest " by using cudnn 5.1 based on CUDA 8.0 Any comments ?

4 tests from SoftmaxWithLossLayerTest/2, where TypeParam = caffe::GPUDevice [ RUN ] SoftmaxWithLossLayerTest/2.TestGradientIgnoreLabel F1124 17:37:00.059399 18786 layer.hpp:343] Check failed: ExactNumBottomBlobs() == bottom.size() (3 vs. 2) SoftmaxWithLoss Layer takes 3 bottom blob(s) as input. *** Check failure stack trace: *** @ 0x7f7b8c32d5cd google::LogMessage::Fail() @ 0x7f7b8c32f433 google::LogMessage::SendToLog() @ 0x7f7b8c32d15b google::LogMessage::Flush() @ 0x7f7b8c32fe1e google::LogMessageFatal::~LogMessageFatal() @ 0xa75bcc caffe::GradientChecker<>::CheckGradientExhaustive() @ 0xa7ad9f caffe::SoftmaxWithLossLayerTest_TestGradientIgnoreLabel_Test<>::TestBody() @ 0xc45e03 testing::internal::HandleExceptionsInMethodIfSupported<>() @ 0xc3eb9a testing::Test::Run() @ 0xc3ece8 testing::TestInfo::Run() @ 0xc3edf5 testing::TestCase::Run() @ 0xc4098f testing::internal::UnitTestImpl::RunAllTests() @ 0xc40cb3 testing::UnitTest::Run() @ 0x7781a9 main @ 0x7f7b83b79830 __libc_start_main @ 0x77a2c9 _start

toki2015 avatar Nov 24 '16 08:11 toki2015

The tests are not running for those layers because I changed the layer but I didn't update the tests.

Fausto Milletarì Sent from my iPhone

On 24 Nov 2016, at 09:48, toki2015 [email protected] wrote:

Met the same problem when "make runtest " by using cudnn 5.1 based on CUDA 8.0 Any comments ?

4 tests from SoftmaxWithLossLayerTest/2, where TypeParam = caffe::GPUDevice [ RUN ] SoftmaxWithLossLayerTest/2.TestGradientIgnoreLabel F1124 17:37:00.059399 18786 layer.hpp:343] Check failed: ExactNumBottomBlobs() == bottom.size() (3 vs. 2) SoftmaxWithLoss Layer takes 3 bottom blob(s) as input. *** Check failure stack trace: *** @ 0x7f7b8c32d5cd google::LogMessage::Fail() @ 0x7f7b8c32f433 google::LogMessage::SendToLog() @ 0x7f7b8c32d15b google::LogMessage::Flush() @ 0x7f7b8c32fe1e google::LogMessageFatal::~LogMessageFatal() @ 0xa75bcc caffe::GradientChecker<>::CheckGradientExhaustive() @ 0xa7ad9f caffe::SoftmaxWithLossLayerTest_TestGradientIgnoreLabel_Test<>::TestBody() @ 0xc45e03 testing::internal::HandleExceptionsInMethodIfSupported<>() @ 0xc3eb9a testing::Test::Run() @ 0xc3ece8 testing::TestInfo::Run() @ 0xc3edf5 testing::TestCase::Run() @ 0xc4098f testing::internal::UnitTestImpl::RunAllTests() @ 0xc40cb3 testing::UnitTest::Run() @ 0x7781a9 main @ 0x7f7b83b79830 __libc_start_main @ 0x77a2c9 _start

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Nov 24 '16 09:11 faustomilletari

You mean I can ignore this error ? Thank you !

toki2015 avatar Nov 24 '16 09:11 toki2015

You can

Fausto Milletarì Sent from my iPhone

On 24 Nov 2016, at 10:19, toki2015 [email protected] wrote:

You mean I can ignore this error ? Thank you !

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Nov 24 '16 09:11 faustomilletari

Hi faustomilletari,

Thank you for the package! I have successfully installed 3D-caffe using "make all" with the warning you guys mentioned.

I also did "make pycaffe" and it is done too. However, when I try "import caffe" in Python, I can the following error message: ImportError: /usr/lib/libboost_python.so.1.62.0: undefined symbol: PyUnicode_AsUTF8String

Any clue what is going on? Really appreciate!!!

hzheng2015 avatar Dec 16 '16 23:12 hzheng2015

Seems something related with boost

Fausto Milletarì Sent from my iPhone

On 16 Dec 2016, at 18:01, hzheng2015 [email protected] wrote:

Hi faustomilletari,

Thank you for the package! I have successfully installed 3D-caffe using "make all" with the warning you guys mentioned.

I also did "make pycaffe" and it is done too. However, when I try "import caffe" in Python, I can the following error message: ImportError: /usr/lib/libboost_python.so.1.62.0: undefined symbol: PyUnicode_AsUTF8String

Any clue what is going on? Really appreciate!!!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Dec 17 '16 00:12 faustomilletari

Thanks Fausto! Could you let me know how did you install boost and libboost_python? what version?

hzheng2015 avatar Dec 17 '16 04:12 hzheng2015

Here are the steps I followed to install 3D-caffe:

  1. install all the dependencies
  2. git clone https://github.com/faustomilletari/3D-Caffe
  3. cp Makefile.config.example Makefile.config
  4. make a few changes in Makefile.config
  5. make all & make runtest
  6. make pycaffe

Let me know if I am missing anything. Thanks!

hzheng2015 avatar Dec 17 '16 04:12 hzheng2015

You can maybe refer to this https://github.com/tensorflow/tensorflow/issues/479 the discussion refers to tensorflow but I think the findings apply to this case as well.

Fausto Milletarì Sent from my iPhone

On 16 Dec 2016, at 23:48, hzheng2015 [email protected] wrote:

Here are the steps I followed to install 3D-caffe:

install all the dependencies git clone https://github.com/faustomilletari/3D-Caffe cp Makefile.config.example Makefile.config make a few changes in Makefile.config make all & make runtest make pycaffe Let me know if I am missing anything. Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Dec 17 '16 18:12 faustomilletari

Hi

Instead of ATLAS if I use openBLAS ,will it be okay ? I know ATLAS is default but there is some issues with server.

thanks

sagarhukkire avatar Feb 07 '17 20:02 sagarhukkire

I guess there will be no difference. everything i’m concerned with runs using cudnn 5

On Feb 7, 2017, at 3:49 PM, sagarax009 [email protected] wrote:

Hi

Instead of ATLAS if I use openBLAS ,will it be okay ? I know ATLAS is default but there is some issues with server.

thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/3D-Caffe/issues/1#issuecomment-278135434, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsvufxRzVhg2E9zVxRL4W3JQhdx_Fqks5raNjegaJpZM4J7KPk.

faustomilletari avatar Feb 07 '17 20:02 faustomilletari

Because there is system ATLAS ,and when I am compiling 3D vent it is giving error for ATLAS. I found solution of installlibatlas-base-dev but it downgrade the atlas version available on server.

what will be issue with cudnn 5 ,which I should use then?

sagarhukkire avatar Feb 07 '17 20:02 sagarhukkire

i think there will be no issue between atlas and cudnn5

so you are good to go

On Feb 7, 2017, at 3:54 PM, sagarax009 [email protected] wrote:

Because there is system ATLAS ,and when I am compiling 3D vent it is giving error for ATLAS. I found solution of installlibatlas-base-dev but it downgrade the atlas version available on server.

what will be issue with cudnn 5 ,which I should use then?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/3D-Caffe/issues/1#issuecomment-278136711, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsviGU9_UqNCSvIgAa7THgRhwlHJHpks5raNn8gaJpZM4J7KPk.

faustomilletari avatar Feb 07 '17 20:02 faustomilletari

I am getting error -latlas could not be found during make all. Is there any way to avoid ,without touching existing atlas?

sagarhukkire avatar Feb 07 '17 21:02 sagarhukkire

If cmake finds it then it has to work. You can refer to caffe documentation to install with Atlas. 3d caffe is not different at all from caffe in this aspect.

Fausto Milletarì Sent from my iPhone

On 7 Feb 2017, at 16:09, sagarax009 [email protected] wrote:

I am getting error -latlas could not be found during make all. Is there any way to avoid ,without touching existing atlas?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Feb 07 '17 22:02 faustomilletari

Okay I will try ,or I will check with openBLAS ,hope it will work.Thanks

sagarhukkire avatar Feb 07 '17 22:02 sagarhukkire

Thanks man this build with cmake worked ...anyway I can train model without preprocessing right?

Or for pre processing which steps you normally used or do you have any script for .mhd files?

sagarhukkire avatar Feb 08 '17 23:02 sagarhukkire

You can try without pre processing:-)

Fausto Milletarì Sent from my iPhone

On 8 Feb 2017, at 18:22, sagarax009 [email protected] wrote:

Thanks man this build with cmake worked ...anyway I can train model without preprocessing right?

Or for pre processing which steps you normally used or do you have any script for .mhd files?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

faustomilletari avatar Feb 09 '17 01:02 faustomilletari

@JianKang1216 @toki2015 Hello I encountered the same issue when I run the "make runtest". This is how I solved it.

First the error looks like: Check failed: ExactNumBottomBlobs() == bottom.size() (3 vs. 2) SoftmaxWithLoss Layer takes 3 bottom blob(s) as input.

I think the error comes out cause the ExactNumBottomBlobs is set to be 3 in the loss_layer.hpp. However, for SoftmaxWithLoss layer the number of input blobs shall be 2: one is the label and the other one is the prediction blob. Therefore, simply change the ExactNumBottomBlobs to be 2 can solve this test error.

@faustomilletari Good job done for the 3D Caffe. Could you please edify this minor bug in the master version so that less people would be confused about this test error?

Thanks! Zhuotun

sunformoon avatar Feb 21 '17 18:02 sunformoon