CRNN Docker/nvidia-docker Installation

Source: Internet
Author: User
Tags locale lua git clone

This paper mainly records the use of Docker/nvidia-docker installation depth learning picture text recognition, development of the operating environment.

In the image text recognition, need to use CTPN and CRNN, the server is ubuntu16, but the above two frameworks (GitHub existing) can only run on UBUNTU14. Considering, publishing and other issues, decided to use Docker to build ubuntu14 in Ubuntu16
cuda7.5 CUDNN3 Development of the operating environment.

The CRNN Docker installation is installed on the basis of the CTPN Docker.

Remember to make certain changes to the thpp_build.sh file before installing it (Cuda compatible):

# Replace Error, https://github.com/facebook/thpp/commit/d9f982c68d7522db9e77e50d135eaa86d84bab85# diff-22577c98d557ea9eca089e8e84d7f98d
sed-i ' 191s/.*/return thtensor_ (max) (values, indices, T, dim,1);/' detail/ TensorGeneric.h
sed-i ' 195s/.*/return thtensor_ (min) (values, indices, T, dim,1);/' Detail/tensorgeneric.h
Sed-i ' 198s/.*/return thtensor_ (sum) (R, T, dim,1);/' detail/tensorgeneric.h 

The Docker files are as follows:

# based on the previous CTPN from Ctpn_docker maintainer Xiongyu haluoluo@qq.com RUN apt-get update && apt-get install-y \ Soft Ware-properties-common \ libssl-dev \ libzmq3-dev \ python-dev \ python-zmq \ sudo # Run Torch7 installation SC Ripts RUN git clone https://github.com/torch/distro.git/root/torch--recursive && cd/root/torch && \ b Ash install-deps && \/install.sh # Export Environment variables manually ENV lua_path= '/root/.luarocks/share/ Lua/5.1/?. Lua;/root/.luarocks/share/lua/5.1/?/init.lua;/root/torch/install/share/lua/5.1/?. Lua;/root/torch/install/share/lua/5.1/?/init.lua;. /?. Lua;/root/torch/install/share/luajit-2.1.0-beta1/?. Lua;/usr/local/share/lua/5.1/?. Lua;/usr/local/share/lua/5.1/?/init.lua ' ENV lua_cpath= '/root/.luarocks/lib/lua/5.1/? So;/root/torch/install/lib/lua/5.1/?. So;. /?. So;/usr/local/lib/lua/5.1/?. So;/usr/local/lib/lua/5.1/loadall.so ' env path=/root/torch/install/bin: $PATH env ld_library_path=/root/torch/ Install/lib: $LD _libRary_path env dyld_library_path=/root/torch/install/lib: $DYLD _library_path env lua_cpath= '/root/torch/install/lib/ ?. So; ' $LUA _cpath ADD torch-0.1.12.post2-cp27-none-linux_x86_64.whl/root/pytorch_install/ TORCH-0.1.12.POST2-CP27-NONE-LINUX_X86_64.WHL workdir/root/pytorch_install/run pip Install TORCH-0.1.12.POST2-CP27-NONE-LINUX_X86_64.WHL &&\ rm TORCH-0.1.12.POST2-CP27-NONE-LINUX_X86_64.WHL RUN PIP Install torchvision RUN pip install lmdb-i https://pypi.tuna.tsinghua.edu.cn/simple/RUN pip install mahotas-i https://p Ypi.tuna.tsinghua.edu.cn/simple/run pip install flask-i https://pypi.tuna.tsinghua.edu.cn/simple/# Install Fblualib and its dependencies:add install_all.sh/root/install_all.sh ADD thpp_build.sh/root/thpp_build.sh workdir/root RUN Ch  MoD +x./install_all.sh run./install_all.sh # clone the crnn repo:run git Clone https://github.com/bgshih/crnn.git RUN Apt-get update && apt-get install-y \ Liblmdb-dev workdir/root/crnn/src RUN CHMOD +x build_cpp.sh run./build_cpp.sh # The following locale is to display the Chinese RUN locale-gen en_US. UTF-8 ENV lang= ' en_US. UTF-8 ' language= ' en_us:en ' lc_all= ' en_US.
 UTF-8 '

Operation Result:

Finally, a Web demo was made based on flask and the results were as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.