【问题标题】:Get Lua running with Torch on Windows 10 (with limited admin rights)在 Windows 10 上使用 Torch 运行 Lua(管理员权限有限)
【发布时间】:2018-06-24 22:10:30
【问题描述】:

设置深度学习框架 [Lua, Torch]:

我需要设置 LuaTorch 一起运行 在 Windows 10ZeroBrane IDE 上,安装软件的可能性有限且下载权限受限。

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

【问题讨论】:

    标签: lua installation deep-learning torch zerobrane


    【解决方案1】:

    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
    @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. 在 C:\Users\Name.zbstudio 中生成 user.lua 文件:

      path.lua = [[C:\app\tools\torch\bin\luajit.exe]]
      
    3. 将 C:\app\tools\torch\lua 文件夹移动到 C:\app\tools\torch\bin

    --- 未经测试的替代品 ---

    未经测试,但我鼓励你: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 视频教程来了解基础知识 (https://github.com/Atcold/torch-Video-Tutorials)

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

    【讨论】:

    • 安装 ZeroBrane Studio 不需要管理员权限,因为您可以简单地解压缩 Windows 的 zip 安装存档。此外,您还需要 IDE 的 torch7 插件。
    • 感谢您的贡献。 ZeroBrane IDE 的好工作。
    猜你喜欢
    • 2023-01-04
    • 1970-01-01
    • 2023-01-20
    • 2013-07-24
    • 2021-10-24
    • 2023-04-03
    • 1970-01-01
    • 2015-09-08
    • 2011-09-19
    相关资源
    最近更新 更多