关于NeuralTalk2

环境配置

参考的步骤进行配置

1
https://github.com/karpathy/neuraltalk2/tree/3c81602809b8b9e5bd3e9e213bf955986485dda7\

我的环境是macOS + M1

1
2
3
4
5
$ curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
$ git clone https://github.com/torch/distro.git ~/torch --recursive
$ cd ~/torch;
$ ./install.sh # and enter "yes" at the end to modify your bashrc
$ source ~/.bashrc

接下来

1
2
3
$ luarocks install nn
$ luarocks install nngraph
$ luarocks install image

在上面进行luarock安装的时候报错

1
2
3
4
5
Installing https://raw.githubusercontent.com/torch/rocks/master/nn-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/nn-scm-1.rockspec... switching to 'build' mode
正克隆到 'nn'...
fatal: 无法连接到 github.com:
github.com[0: 140.82.121.4]: errno=Operation timed out

我的解决方案有两个步骤

  1. (我觉得这个问题和这个步骤没关系) 我首先安装了lua
1
2
3
4
$ curl -R -O http://www.lua.org/ftp/lua-5.4.3.tar.gz
$ tar -zxvf lua-5.4.3.tar.gz
$ cd lua-5.4.3
$ make
  1. 还是stackoverflow好用(不是 ,加这个命令行就好了。
1
git config --global url.https://github.com/.insteadOf git://github.com/

关于NeuralTalk2
http://example.com/2022/07/17/关于NeuralTalk2/
Author
Chenxi Qu
Licensed under