KnetML / MAC-Network

Memory, Attention and Composition (MAC) Network for CLEVR implemented via KnetLayers
MIT License
6 stars 4 forks source link

Can't get this working #1

Closed sgt101 closed 5 years ago

sgt101 commented 5 years ago

Hello, I am really struggling with this notebook.

I have tried setups using windows 10; centos 7 Ubuntu on virtual box and fedora on Virtual box. I have tried the Knet AMI in Ohio region and I have tried fedora and ubuntu deep learing AMIs as well. The problem is that if I use a Linux that works with Knet (amazon or fedora or even centos) then they don't have libz.so.1.2.9 or later, so ImageMagick will fail - the julia Libld will use /lib64 to find it and I can't figure out how to change that so that it uses a local path. On Ubuntu amis there is a KNet test fail in conv.jl which seems to cause the notebook to blow up at

results,prediction,interoutputs = singlerun(Mrun,feat,question;p=o[:p],selfattn=o[:selfattn],gating=o[:gating]);

(segmentation fault)

Can you say exactly the config that you are using to get this to work ? I saw it demoed at CSAIL so I know it does! Or can you give me the tip that will let me reset the Libld to use the right Libz?

ekinakyurek commented 5 years ago

Could you post the error message here?

sgt101 commented 5 years ago

I am a good opensourcer - I will post the error and I have a simple fix (next comment) Here is the error

_img = load("data/demo/CLEVR_v1.0/images/val/$(inst[1])")

┌ Info: Recompiling stale cache file /home/ec2-user/.julia/compiled/v1.0/ImageMagick/0LbNX.ji for ImageMagick [6218d12a-5da1-5696-b52f-db25d2ecc6d1] └ @ Base loading.jl:1184 Error encountered while loading "/home/ec2-user/MAC-Network/data/demo/CLEVR_v1.0/images/val/CLEVR_val_013354.png". Fatal error:

InitError: error compiling init: could not load library "/home/ec2-user/.julia/packages/ImageMagick/d5KBL/deps/usr/lib/libMagickWand-6.Q16.so" /lib64/libz.so.1: version `ZLIB1.2.9' not found (required by /home/ec2-user/.julia/packages/ImageMagick/d5KBL/deps/usr/lib/libpng16.so.16) during initialization of module ImageMagick <<<<<<< Nasty! If you run this in the console and look at Libdl.findlibrary for libz it says /lib64 and here's the catch - you can't reset that - changing DL_LOAD_PATH makes no difference, the linker stubbonly reports /lib64 and for all the aims that seem to be ok with KNet (as in test Knet passes) that means libz.1.2.8 or lower. However the fix is really easy

sgt101 commented 5 years ago

Here is the fix. The issue is that the linker is lazy and if it finds any libz then that's the one it will use, in the natural course of things it will find /lib64/libz.so.1 and that's what it will insist on. but if you simply add a cell (or loc)

using ImageMagick as the very first thing your kernel runs (so top of the notebook) then it will link to the libz.so.1 in the ImageMagick binary. And that one is 1.2.11 and is all good.

Pheeww - I am very happy; thank you for your work here - this is a great example that I am going to use in a lecture in a few weeks (now I can make it work!)

ekinakyurek commented 5 years ago

Thank you, this is solved in current master