在Windows 10上使用Torch运行Lua(具有有限的管理权限)

时间:2018-01-16 08:48:53

标签: lua installation deep-learning torch zerobrane

  

建立深度学习框架[Lua,Torch]:

我需要设置使用 Torch 运行的 Lua Windows 10 ZeroBrane IDE 上,安装软件和限制下载权限的可能性有限。

我花了这么长时间,所以我想我可能会为你们分享食谱。如果它对你有所帮助,我会很高兴。

1 个答案:

答案 0 :(得分:3)

  

SETTING UP

  1. (管理员)下载/安装tdm64 / gcc / 5.1.0-2.exe编译器
  2. (管理员)下载/安装ZeroBrane(Lua IDE)
  3. 下载lua / 5.3.4.tar.gz(https://www.lua.org/download.html
  4. 编写批处理文件build.cmd
  5. @echo off
    setlocal
    :: you may change the following variable's value
    :: to suit the downloaded version
    set lua_version=5.3.4
    set work_dir=%~dp0
    :: Removes trailing backslash
    :: to enhance readability in the following steps
    set work_dir=%work_dir:~0,-1%
    set lua_install_dir=%work_dir%\lua
    set compiler_bin_dir=%work_dir%\tdm-gcc\bin
    set lua_build_dir=%work_dir%\lua-%lua_version%
    set path=%compiler_bin_dir%;%path%
    
    cd /D %lua_build_dir%
    mingw32-make PLAT=mingw
    
    echo.
    echo **** COMPILATION TERMINATED ****
    echo.
    echo **** BUILDING BINARY DISTRIBUTION ****
    echo.
    
    :: create a clean "binary" installation
    mkdir %lua_install_dir%
    mkdir %lua_install_dir%\doc
    mkdir %lua_install_dir%\bin
    mkdir %lua_install_dir%\include
    
    copy %lua_build_dir%\doc\*.* %lua_install_dir%\doc\*.*
    copy %lua_build_dir%\src\*.exe %lua_install_dir%\bin\*.*
    copy %lua_build_dir%\src\*.dll %lua_install_dir%\bin\*.*
    copy %lua_build_dir%\src\luaconf.h %lua_install_dir%\include\*.*
    copy %lua_build_dir%\src\lua.h %lua_install_dir%\include\*.*
    copy %lua_build_dir%\src\lualib.h %lua_install_dir%\include\*.*
    copy %lua_build_dir%\src\lauxlib.h %lua_install_dir%\include\*.*
    copy %lua_build_dir%\src\lua.hpp %lua_install_dir%\include\*.*
    
    echo.
    echo **** BINARY DISTRIBUTION BUILT ****
    echo.
    
    %lua_install_dir%\bin\lua.exe -e"print [[Hello!]];print[[Simple Lua test successful!!!]]"
    
    echo.
    
    pause
    
      

    在WINDOWS的LUA下设置TORCH

    ---又快又脏---

    1. https://github.com/hiili/WindowsTorch
    2. 下载并解压缩所需的二进制版本
    3. 在C:\ Users \ Name.zbstudio:

      中生成user.lua文件
      path.lua = [[C:\app\tools\torch\bin\luajit.exe]]
      
    4. 将C:\ app \ tools \ torch \ lua文件夹移至C:\ app \ tools \ torch \ bin

    5. ---未经考验的替代品---

      未经测试,但我鼓励您:https://github.com/torch/torch7/wiki/Windows#cmder 也许第二个最好的选择是使用linux构建虚拟环境

      注意:有关Torch的更多信息,请点击此处 https://github.com/soumith/cvpr2015/blob/master/cvpr-torch.pdf

        

      开始使用LUA和TORCH

      http://torch.ch/docs/tutorials.html 我建议使用Torch Video Tutorials直接获得基础知识(https://github.com/Atcold/torch-Video-Tutorials

      这是一张Torch Cheetsheet供进一步阅读(https://github.com/torch/torch7/wiki/Cheatsheet): - 新手 - 安装和运行Torch - 安装包 - 教程,按类别演示 - 加载热门数据集 - 按类别列出的包裹