martinbenson / deep-photo-styletransfer

Implementation of "Deep Photo Style Transfer": https://arxiv.org/abs/1703.07511
MIT License
204 stars 27 forks source link

dockerfile issue: sudo: command not found #6

Closed xxlatgh closed 7 years ago

xxlatgh commented 7 years ago

Hi Martin, Thank you for providing the dockerfile!

I was getting the following error messages when i tried to build the docker image. install-deps: line 155: sudo: command not found
Some portion of the update is failed install-deps: line 161: sudo: command not found
The command '/bin/sh -c git clone https://github.com/torch/distro.git ~/torch --recursive &&
cd ~/torch && bash install-deps && ./install.sh' returned a non-zero code: 127

Then I fixed it by adding the following code after # Install dependencies RUN apt-get update && \
apt-get -y install sudo

Not perfect but it works, perhaps you can take a look at this issue?

martinbenson commented 7 years ago

This seems strange, since the image builds fine for me as is and also everything runs as root anyway, so sudo is not needed?

Multiboxer commented 7 years ago

This happened to me when I ran the dockerfile through zsh instead of bash, quick fix was to switch to bash with exec bash after that it worked perfectly.

martinbenson commented 7 years ago

Thanks @Multiboxer - do you mean if you try to run docker build from zsh it fails?

xxlatgh commented 7 years ago

@martinbenson I'm having encountering a few problems in the final step of building the dockerfile. First I had to change the makefile from cudo-7.5 to cuda-8.0 because i have previously installed cuda-8.0, then addingRUN apt-get install liblua5.1-0-dev before the final step to ensure the system can find lua.h(I got the error messagecuda_utils.cu:2:18: fatal error: lua.h: No such file or directory). Now I'm getting this error(below) and it might be because the container is running out the memory. Can you give me some advice on how to solve this? Thank you!

The following additional packages will be installed:
  libtool-bin pkg-config
The following NEW packages will be installed:
  liblua5.1-0-dev libtool-bin pkg-config
0 upgraded, 3 newly installed, 0 to remove and 11 not upgraded.
Need to get 244 kB of archives.
After this operation, 1346 kB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
The command '/bin/bash -c apt-get install liblua5.1-0-dev' returned a non-zero code: 1
alashow commented 7 years ago

My build failed too, with install-deps: line 161: sudo: command not found error. Switching to bash from zsh didn't help.

xxlatgh commented 7 years ago

hey @martinbenson, I fixed my earlier error, but i'm having problem with the final line in the dockerfile. Can you give me some pointers on how to fix this?

What I've tried: breaking the last line in the docker file into 3 lines RUN make clean RUN make RUN pip3 install -r gen_laplacian/requirements.txt

What I found: bug is in Step 19/20 : RUN make Step 19/20 : RUN make ---> Running in 2f83ba0f5407 /usr/local/cuda-8.0/bin/nvcc -arch sm_35 -O3 -DNDEBUG --compiler-options '-fPIC' -o libcuda_utils.so --shared cuda_utils.cu -I/home/ubuntu/torch/install/include/THC -I/home/ubuntu/torch/install/include/TH -I/home/ubuntu/torch/install/include -L/home/ubuntu/torch/install/lib -Xlinker -rpath,/home/ubuntu/torch/install/lib -lluaT -lTHC -lTH -lpng cuda_utils.cu:2:18: fatal error: lua.h: No such file or directory compilation terminated. makefile:10: recipe for target 'libcuda_utils.so' failed make: *** [libcuda_utils.so] Error 1 The command '/bin/bash -c make' returned a non-zero code: 2

martinbenson commented 7 years ago

Hi folks. Apologies, there were two problems with it:

  1. I pulled the cuda image from dockerhub ages ago and they updated it to ubuntu 16 underneath me. So, I've just specified the ubuntu 14 image since it works.
  2. I hacked the upstream makefile and copied in during the build and then forgot to add the edited makefile. I've fixed this properly by just editing the makefile in the fork

I'm hopeful this will resolve everyone's issues - but do not that you'll need recent nvidia drivers and nvidia-docker.