本文介绍了在 Windows 10 上使用 Torch 运行 Lua(具有有限的管理员权限)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

解决方案
  1. (管理员)下载/安装 tdm64/gcc/5.1.0-2.exe 编译器
  2. (管理员)下载/安装 ZeroBrane (Lua IDE)
  3. 下载lua/5.3.4.tar.gz (https://www.lua.org/下载.html)
  4. 编写批处理文件build.cmd
@echo off设置本地:: 您可以更改以下变量的值:: 适合下载的版本设置 lua_version=5.3.4设置 work_dir=%~dp0:: 删除尾随反斜杠:: 在以下步骤中提高可读性设置 work_dir=%work_dir:~0,-1%设置 lua_install_dir=%work_dir%lua设置 compiler_bin_dir=%work_dir%	dm-gccin设置 lua_build_dir=%work_dir%lua-%lua_version%设置路径=%compiler_bin_dir%;%path%cd/D %lua_build_dir%mingw32-make PLAT=mingw回声.回声 **** 编译终止 ****回声.echo **** 构建二进制分布 ****回声.:: 创建一个干净的二进制"安装mkdir %lua_install_dir%mkdir %lua_install_dir%docmkdir %lua_install_dir%inmkdir %lua_install_dir%include复制 %lua_build_dir%doc*.* %lua_install_dir%doc*.*复制 %lua_build_dir%src*.exe %lua_install_dir%in*.*复制 %lua_build_dir%src*.dll %lua_install_dir%in*.*复制 %lua_build_dir%srcluaconf.h %lua_install_dir%include*.*复制 %lua_build_dir%srclua.h %lua_install_dir%include*.*复制 %lua_build_dir%srclualib.h %lua_install_dir%include*.*复制 %lua_build_dir%srclauxlib.h %lua_install_dir%include*.*复制 %lua_build_dir%srclua.hpp %lua_install_dir%include*.*回声.回声 **** 二进制分布构建 ****回声.%lua_install_dir%inlua.exe -e"print [[Hello!]];print[[简单Lua测试成功!!!]]"回声.暂停

在WINDOWS上的LUA下设置TORCH

---又快又脏---

  1. 从以下位置下载并解压缩所需的二进制版本:https://github.com/hiili/WindowsTorch
  2. 在 C:UsersName.zbstudio 中生成 user.lua 文件:

    path.lua = [[C:app	ools	orchinluajit.exe]]

  3. 将 C:appoolsorchlua 文件夹移动到 C:appoolsorchin

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

未测试,但我鼓励您: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-视频教程)

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

I need to set up Lua running with Torchon 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. (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


--- 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:app	ools	orchinluajit.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#cmderMaybe second best option is to build a virtual environment with linux

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


http://torch.ch/docs/tutorials.htmlI 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

这篇关于在 Windows 10 上使用 Torch 运行 Lua(具有有限的管理员权限)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-09 21:40