2

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

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

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

4

1 回答 1

4

配置

  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 - 安装包 - 教程,按类别演示 - 加载流行数据集 - 包列表按类别

于 2018-01-16T08:48:53.277 回答