Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
912 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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%dm-gccin
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%in
mkdir %lua_install_dir%include

copy %lua_build_dir%doc*.* %lua_install_dir%doc*.*
copy %lua_build_dir%src*.exe %lua_install_dir%in*.*
copy %lua_build_dir%src*.dll %lua_install_dir%in*.*
copy %lua_build_dir%srcluaconf.h %lua_install_dir%include*.*
copy %lua_build_dir%srclua.h %lua_install_dir%include*.*
copy %lua_build_dir%srclualib.h %lua_install_dir%include*.*
copy %lua_build_dir%srclauxlib.h %lua_install_dir%include*.*
copy %lua_build_dir%srclua.hpp %lua_install_dir%include*.*

echo.
echo **** BINARY DISTRIBUTION BUILT ****
echo.

%lua_install_dir%inlua.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:UsersName.zbstudio:

    path.lua = [[C:appoolsorchinluajit.exe]]
    
  3. Move the C:appoolsorchlua folder to C:appoolsorchin

--- 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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...