Get Lua running with Torch on Windows 10 (with limited admin rights)

断了今生、忘了曾经 提交于 2019-12-02 09:22:08

问题


Setting up Deep Learning Framework [Lua, Torch]:

I need to set up Lua running with Torch on Windows 10 and the ZeroBrane IDE, with limited possibilities of installing Software and restricted download rights.

It took me so Long, so I thought I might share a recipe for you guys. I would be glad if it helped you.


回答1:


SETTING UP

  1. (Admin) Download/Install tdm64/gcc/5.1.0-2.exe Compiler
  2. (Admin) Download/Install ZeroBrane (Lua IDE)
  3. Download lua/5.3.4.tar.gz (https://www.lua.org/download.html)
  4. Write batch file 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

SETTING UP TORCH UNDER LUA ON WINDOWS

--- Quick and dirty ---

  1. Download and unzip the desired binary build from: https://github.com/hiili/WindowsTorch
  2. Generate user.lua file in C:\Users\Name.zbstudio:

    path.lua = [[C:\app\tools\torch\bin\luajit.exe]]
    
  3. Move the C:\app\tools\torch\lua folder to C:\app\tools\torch\bin

--- Untested alternatives ---

Not tested, but I encourage you: https://github.com/torch/torch7/wiki/Windows#cmder Maybe second best option is to build a virtual environment with linux

Note: More information on Torch can be found here https://github.com/soumith/cvpr2015/blob/master/cvpr-torch.pdf


GET STARTED WITH LUA AND TORCH

http://torch.ch/docs/tutorials.html I recommend Torch Video Tutorials to get the basics straight (https://github.com/Atcold/torch-Video-Tutorials)

This is a Torch Cheetsheet for further reading (https://github.com/torch/torch7/wiki/Cheatsheet): - Newbies - Installing and Running Torch - Installing Packages - Tutorials, Demos by Category - Loading popular datasets - List of Packages by Category



来源:https://stackoverflow.com/questions/48277220/get-lua-running-with-torch-on-windows-10-with-limited-admin-rights

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!