lmb-freiburg / flownet2-docker

Dockerfile and runscripts for FlowNet 2.0 (estimation of optical flow)
https://lmb.informatik.uni-freiburg.de/Publications/2017/IMKDB17/
GNU General Public License v3.0
158 stars 52 forks source link

libcudart.so.8.0: cannot open shared object file: No such file or directory #11

Closed ahmedbilal closed 5 years ago

ahmedbilal commented 5 years ago
sudo make

ran successfully. It created two images flownet2 and nvidia/cuda. But, when i try to run

sudo ./run-network.sh -n FlowNet2-s -vv data/flow-first-images.txt data/flow-second-images.txt data/flow-outputs.txt

or

sudo ./run-network.sh -n FlowNet2 -v data/0000000-imgL.png data/0000001-imgL.png flow.flo

It says ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory.

Specification Distribution: Ubuntu 18.10 (PopOS) CPU: Intel i7-3840QM GPU: Nvidia Quadro k2000m (Dedicated 2GB) RAM: 8 GB

nikolausmayer commented 5 years ago
ahmedbilal commented 5 years ago
nikolausmayer commented 5 years ago

Strange. The file exists but is not found? Hm, here's one more idea: after source set-env.sh; in the run-network.sh script, add export LD_LIBRARY_PATH=/usr/local/cuda/lib64/$LD_LIBRARY_PATH;

If this does not work, I'm not sure what to do. It could be that Ubuntu 18.10 is not officially supported by nvidia-docker..

nikolausmayer commented 5 years ago

I should note that the Docker image works fine on my system:

ahmedbilal commented 5 years ago

It says "./run-network.sh: 165: ./run-network.sh: LD_LIBRARY_PATH: parameter not set"

ahmedbilal commented 5 years ago

I tried removing the $LD_LIBRARY_PATH. Now, it is saying ImportError: libGL.so.1: cannot open shared object file: No such file or directory

ahmedbilal commented 5 years ago

After adding

"export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:/usr/lib/x86_64-linux-gnu/mesa/:/usr/local/nvidia/lib:/usr/local/nvidia/lib64/;"

next to set-env.sh;

It proceed. But, now I am getting "Check failed: error == cudaSuccess (35 vs. 0) CUDA driver version is insufficient for CUDA runtime version"

nikolausmayer commented 5 years ago

Ok. That's definitely an issue either with your local nvidia driver, or with nvidia-docker... AFAIK CUDA 8 requires a driver >= 367.4.

ahmedbilal commented 5 years ago

At last, with your help I am able to run it. It creates .flo files successfully. I used the following

if test $VERBOSITY -ge 2; then
  nvidia-docker run \
    --rm \
    --volume "${PWD}:/input-output:rw" \
    --workdir "${WORKDIR}" \
    -it "$CONTAINER" /bin/bash -c "cd ..; source set-env.sh; ldconfig ; export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:/usr/lib/x86_64-linux-gnu/mesa/:/usr/local/nvidia/lib:/usr/local/nvidia/lib64/; cd -; python run-flownet-docker.py --verbose --gpu ${GPU_IDX} ${WEIGHTS} ${DEPLOYPROTO} ${FIRST_INPUT} ${SECOND_INPUT} ${OUTPUT}"
else
  nvidia-docker run \
    --rm \
    --volume "${PWD}:/input-output:rw" \
    --workdir "${WORKDIR}" \
    -it "$CONTAINER" /bin/bash -c "cd ..; source set-env.sh; ldconfig ; export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:/usr/lib/x86_64-linux-gnu/mesa/:/usr/local/nvidia/lib:/usr/local/nvidia/lib64/; cd -; python run-flownet-docker.py --gpu ${GPU_IDX} ${WEIGHTS} ${DEPLOYPROTO} ${FIRST_INPUT} ${SECOND_INPUT} ${OUTPUT}"
    > /dev/null;
fi

Notice the ldconfig and export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:/usr/lib/x86_64-linux-gnu/mesa/:/usr/local/nvidia/lib:/usr/local/nvidia/lib64/.

The last thing is that I was expecting output would be some image but it is unreadable by image viewer. How can I convert these .flo files to images?

Thanks.

nikolausmayer commented 5 years ago

Nice! The outputs are floating-point flow fields which is far too niche to be understood by normal image viewers. You can convert them to colorful images with the help of the Middlebury group's code: http://vision.middlebury.edu/flow/data/ (search for "flow-code" or "flow-code-matlab").

ahmedbilal commented 5 years ago

@nikolausmayer Thanks. But, flow-code isn't taking .flo as command line argument. Its README also doesn't specifies how to pass the name of .flo file.

ahmedbilal commented 5 years ago

@nikolausmayer Thank you very much for helping. I can be able to generate the image using the following command

./color_flow 10 0000000-flow.flo out.png

image

ahmedbilal commented 5 years ago

@nikolausmayer The last thing I want to ask why it has wired result when run on these two frames. (My guess is that there is some issue in these frames) image image image

nikolausmayer commented 5 years ago

What network did you use to process that image pair? This image pair contains mostly zero and some small motions. This is a good candidate for "FlowNet2-SD" which specializes in small flows.

ahmedbilal commented 5 years ago

Earlier I used Flownet2-s. But, now I used FlowNet2-SD as you suggested and It is pretty good. Thanks again. image