安装torch与luarocks的一些问题

  1. Installing Torch : 参考网址: http://torch.ch/docs/getting-started.html

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

  2. 安装luarocks

    sudo apt-get install luarocks

  3. 测试:

    luarocks install image
    luarocks list

  4. 执行 $ luarocks install image 时,若出现如下错误:

    Error: Your user does not have write permissions in /usr/local/lib/luarocks/rocks
    – you may want to run as a privileged user or use your local tree with –local.

  5. 解决办法: install torch with Lua 5.2 instead of LuaJIT, simply run:

    # clean old torch installation
    cd ~torch
    ./clean.sh
    TORCH_LUA_VERSION=LUA52 ./install.sh

    程序执行到最后,会询问:

    Do you want to automatically prepend the Torch install location
    to PATH and LD_LIBRARY_PATH in your /home/hri/.bashrc? (yes/no)
    [yes] >>>

    输入:

    yes

    这时候,打开~/.bashrc,

    sudo gedit ~/.bashrc

    在末尾会见到: . /home/hri/torch/install/bin/torch-activate
    其中/home/hri/torch/是torch安装的路径, 关闭./bashrc文件,执行如下命令:

    source ~/.bashrc
    bash

  6. 再次执行 步骤3, 成功,执行

    th

    将出现Getting started with Torch最后的结果

你可能感兴趣的:(Ubuntu,相关软件安装)