当前位置:   article > 正文

char-cnn+torch+ubuntu16.04(RNN) 安装过程_torchdistribution安装

torchdistribution安装

char-cnn+torch+ubuntu16.04(RNN) 安装过程

1. 搭建Torch 环境

1.1 安装Torch7 的依赖项

# in a terminal, run the commands
curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash

cd ~/torch; ./install.sh
  • 1
  • 2
  • 3
  • 4

安装成功的标志是最后显示“==> Torch7’s dependencies have been installed ”

1.2 安装 torch distribution

git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; ./install.sh
  • 1
  • 2

注:安装过程出现以下问题:

1.  ./install.sh: line 59: cmake: command not found
  • 1

意思就是cmake 命令程序没有安装,执行命令

sudo apt install cmake
  • 1

安装,安装成功后继续 cd ~/torch; ./install.sh 命令。

2.  
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
fatal: clone of 'https://github.com/torch/cutorch.git' into submodule path 'extra/cutorch' failed
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

这个报错,原因可能是网络的原因,切到你安装torch 的目录下重新安装:

git clone https://github.com/torch/distro.git ~/torch --recursive
  • 1

直到成功安装,然后继续cd ~/torch; ./install.sh

编译程序
执行下列命令,使得安装过程中被更改的PATH生效:

source ~/.bashrc
  • 1

执行下列命令查看torch 是否安装成功:
$th
这里写图片描述

出现上图图片中的内容表示torch安装成功。

1.3 卸载torch

如果不使用torch,可以使用下列命令卸载:

rm -rf ~/torch
  • 1

可以使用luarocks命令安装其他的torch包

$ luarocks install image
$ luarocks list
  • 1
  • 2

至此Torch 环境 搭建完成

2. 运行char-cnn

2.1 安装必要的包

$ luarocks install nngraph 
$ luarocks install optim
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/726246
推荐阅读
相关标签
  

闽ICP备14008679号