jcjohnson/densecap

libjpeg and libpng version problem

chensivan opened this issue · 3 comments

I'm running to an issue where the version of the packages are just not right. I ran

th run_model.lua -input_image imgs/test.png -gpu -1

It says:

libpng warning: Application built with libpng-1.4.12 but running with 1.6.34
/Users/yanchenm/torch/install/bin/lua: /Users/yanchenm/torch/install/share/lua/5.2/image/init.lua:156: [read_png] png_create_read_struct failed
stack traceback:
	[C]: in function 'load'
	/Users/yanchenm/torch/install/share/lua/5.2/image/init.lua:156: in function 'loader'
	/Users/yanchenm/torch/install/share/lua/5.2/image/init.lua:388: in function 'load'
	run_model.lua:67: in function 'run_image'
	run_model.lua:164: in main chunk
	[C]: in function 'dofile'
	...henm/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
	[C]: in ?

And if I used .jpg

th run_model.lua -input_image imgs/elephant.jpg -gpu -1

/Users/yanchenm/torch/install/bin/lua: /Users/yanchenm/torch/install/share/lua/5.2/image/init.lua:235: Wrong JPEG library version: library is 90, caller expects 80
stack traceback:
	[C]: in function 'load'
	/Users/yanchenm/torch/install/share/lua/5.2/image/init.lua:235: in function 'loader'
	/Users/yanchenm/torch/install/share/lua/5.2/image/init.lua:388: in function 'load'
	run_model.lua:67: in function 'run_image'
	run_model.lua:164: in main chunk
	[C]: in function 'dofile'
	...henm/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
	[C]: in ?

I've tried to uninstall libjpeg and libpng, and also had libjpeg8d (with 9 and w/o), and libpng1.4.12 (with 1.6 and w/o) copied in the same location. I tried both lua5.2, 5.3.

I'm using MacOS 10.12.6. Please help!

Did you find any solution??
same issue here..

Found a solution, albeit kinda hacky
first i removed all libpng files from my computer
brew uninstall libpng' found the rest using find /usr/ /Library/ /opt/ /lib/ -iname "libpng*.dylib" 2>/dev/nullmanually runningrm` on the results.

Then i followed the instructions here to install libpng 1.4.12
http://mac-dev-env.patrickbougie.com/libpng/
and created my own symlinks.
The symlinks created on that website arent the right ones.
To find the right ones I reinstalled libpng using homebrew
brew install libpng
and saw replaced all the symlinks it created. The symlinks should be in /usr/local/lib/

the same question, and many methods have tried but no one succeed... TAT