当前位置: 首页 > 工具软件 > Torch7 > 使用案例 >

Torch7 out of memory 解决方法

齐琦
2023-12-01

造成out of memory 的主要原因是Lua默认的编译器LuaJIT的内存限制为2GB,解决的方法是用Lua代替LuaJIT,https://github.com/torch/distro介绍了替换方法,具体操作如下:

1. 卸载之间安装的torch

     1.1 进入torch安装路径

              ./clean.sh

     1.2 删除安装的文件

              rm -rf ./install.sh

     1.3 删除添加的环境变量

            在~./bashrc和~./profile这两个文件中,找到torch-activate项删除


2. 下载torch源码

        git clone https://github.com/torch/distro


3. 进入源码目录,安装依赖项

       ./install-deps.sh


4. 安装torch 

    TORCH_LUA_VERSION=LUA51 ./install.sh

 类似资料: