jzbontar / mc-cnn

Stereo Matching by Training a Convolutional Neural Network to Compare Image Patches
BSD 2-Clause "Simplified" License
707 stars 232 forks source link

Error when loading module #5

Open YaoChou opened 8 years ago

YaoChou commented 8 years ago

Hi Jure,

Thanks so much for sharing this code. I am trying to running the code following your instruction. However I got a error when I ran the command

./main.lua kitti fast -a predict -net_fname net/net_kittifast-a_train_all.t7 -left samples/input/kittiL.png -right samples/input/kittiR.png -disp_max 70

The error is

luajit: error loading module 'libadcensus' from file './libadcensus.so': ./libadcensus.so: undefined symbol: png_set_longjmp_fn stack traceback: [C]: at 0x0047aff0 [C]: in function 'require' ./main.lua:327: in main chunk [C]: at 0x00406670

Do you have any suggestions about it? Thanks!

Yao

jzbontar commented 8 years ago

Hi Yao,

I haven't seen this before. Looks like a problem with the png++ library. Which version of png++ library are you using?

YaoChou commented 8 years ago

Probably yes, I had a trouble when I installed png++, couple test can not pass, but I think I install it right now. I use the latest version, png++-0.2.9. Thanks!

jzbontar commented 8 years ago

Can you please paste the output of the following command:

$ ldd libadcensus.so

YaoChou commented 8 years ago

Here they are. linux-vdso.so.1 => (0x00007fffd0d35000) libluaT.so => /home/ecestudent/torch/install/lib/libluaT.so (0x00007f87a4d88000) libTHC.so => /home/ecestudent/torch/install/lib/libTHC.so (0x00007f87a2ae2000) libTH.so => /home/ecestudent/torch/install/lib/libTH.so (0x00007f87a2669000) libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f87a2443000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f87a223b000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f87a201d000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f87a1e19000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f87a1b15000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f87a180f000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f87a15f9000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f87a1234000) libcudart.so.7.5 => /usr/local/cuda/lib64/libcudart.so.7.5 (0x00007f87a0fd6000) libcublas.so.7.5 => /usr/local/cuda/lib64/libcublas.so.7.5 (0x00007f879f6f7000) libmkl_gf_lp64.so => /opt/intel/mkl/lib/intel64/libmkl_gf_lp64.so (0x00007f879ed93000) libmkl_gnu_thread.so => /opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so (0x00007f879de1f000) libmkl_core.so => /opt/intel/mkl/lib/intel64/libmkl_core.so (0x00007f879c498000) libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f879c289000) /lib64/ld-linux-x86-64.so.2 (0x00007f87a5231000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f879c070000)

jzbontar commented 8 years ago

On my machine it's linking against libpng16.

libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007fc45b0e8000)

Could you try updating libpng?

YaoChou commented 8 years ago

Sorry just saw your reply.

I update the libpng to the newest version in my computer, but still the version of 12. So still get the same above error when loading module.

why your version is libpng16, which png++ package version are you using?

Thanks!

jzbontar commented 8 years ago

I'm using png++ 0.2.9 and libpng 1.6.21. The png++ is a C++ wrapper around libpng, so it might matter which libpng library you have installed.

YaoChou commented 8 years ago

I use the same version png++ with yours. but the libpng is 1.2.50, however, the computer shows it's already the newest version, I will re install it, see if I can get the version 1.6.21. Thanks!

xiao1228 commented 8 years ago

Hi @YaoChou I got the same error as you. Did you figure out how to fix it? I updated the libpng the error is still there. Thank you for the help.

jzbontar commented 8 years ago

The png++ library seems to be responsible for the majority of complaints I receive. I'm planning to rewrite the code so that png++ is not used anymore. Stay tuned!

adong7639 commented 7 years ago

Reference:

In my case, I have the old png 1.2 came with my ubuntu installed in /usr. I installed the 1.6.x in /usr/local. In my make system, the default include /usr/include and linking /usr/lib were picked up. When compiling any software that rely on the new interface, you need to add

CPPFLAGS="-I/usr/local/include $CPPFLAGS" LDFLAGS="-L/usr/local/lib $LDFLAGS"

this will pick up

grep png_set_longjmp_fn png.h PNG_EXPORT(8, jmp_buf, png_set_longjmp_fn, (png_structrp png_ptr, (png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))

Then libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f8ac214e000) change to libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x00007fc9c273f000)

ranjeethks commented 6 years ago

Hi Adong,

I am getting the same error, although I installed libpng-1.6.21, I am not sure why I still get "libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007fa102c9f000)" when I run $ ldd libadcensus.so. Could you please tell where do I write the below?

CPPFLAGS="-I/usr/local/include $CPPFLAGS" LDFLAGS="-L/usr/local/lib $LDFLAGS"

PLease suggest how can I correct the error: "luajit: error loading module 'libadcensus' from file './libadcensus.so': ./libadcensus.so: undefined symbol: png_set_longjmp_fn"

ranjeethks commented 6 years ago

I solved this issue by updating my libpng12 to libpng16 by executing following commands

sudo apt-get update sudo apt-get install libpng16-dev

after this, libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 changed to.. libpng16.so.16 => /usr/local/lib/libpng16.so.16