• Torch 的安装与基本用法


    本文安装仅限 ubuntu 系统。官方文档见:Getting started with Torch

    0. 简介

    • Torch 使用轻量级脚本语言 Lua 及其 C/CUDA 扩展模块实现,底层数值计算通过高效的 OpenMP/SSE/CUDA 加速;

    1. 安装

    进入命令行终端,分别执行下面三行的代码,

    git clone https://github.com/torch/distro.git ~/torch --recursive
    cd ~/torch; bash install-deps;
    ./install.sh

    install.sh脚本会自动将 torch 路径添加进 Path 变量,因此还需执行下述代码以刷新环境变量。

    # On Linux with bash
    source ~/.bashrc
    # On Linux with zsh
    source ~/.zshrc
    # On OSX or in Linux with none of the above.
    source ~/.profile

    2. 安装第三方库

    • $ luarocks list:查看已安装库;
    • $ luarocks install image:安装 image库;
      • $ luarocks list:再次查看是否已安装 image 库;

    3. torch 命令行环境

    在 ubuntu 命令行输入 th以进入 torch 的 repl (read-eval-print loop)环境。

    $ th
    
      ______             __   |  Torch7 
     /_  __/__  ________/ /   |  Scientific computing for Lua. 
      / / / _ / __/ __/ _   |  Type ? for help 
     /_/  \___/_/  \__/_//_/  |  https://github.com/torch 
                              |  http://torch.ch 
    
    • th> os.exit():退出;
  • 相关阅读:
    mysql book网盘
    mysql数据库测试库下载
    TEMP
    测试
    吴炳锡
    ACMUG
    mysql select语句执行顺序
    mysql mha高可用架构的安装
    执行计划解读 简朝阳 (Sky Jian) and 那蓝蓝海
    mysql字符串比较
  • 原文地址:https://www.cnblogs.com/mtcnn/p/9421452.html
Copyright © 2020-2023  润新知