我尝试加载大型音频数据集并实现audio.spectrogram. 我收到了这个错误: $Torch: not enough memory: you tried to allocate 0GB. Buy new RAM! at /home/XXXX/torch/pkg/torch/lib/TH/THGeneral.c:222stack traceback:[C]: at 0xb73
我收到了这个错误:
$Torch: not enough memory: you tried to allocate 0GB. Buy new RAM! at /home/XXXX/torch/pkg/torch/lib/TH/THGeneral.c:222 stack traceback: [C]: at 0xb732c560 [C]: in function '__add' /home/XXXX/torch/install/share/lua/5.1/audio/init.lua:107: in function 'spectrogram' large.lua:24: in main chunk [C]: in function 'dofile' [string "_RESULT={dofile "large.lua"}"]:1: in main chunk [C]: in function 'xpcall' /home/XXXX/torch/install/share/lua/5.1/trepl/init.lua:650: in function 'repl' ...XX/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk [C]: at 0x0804d6d0
torch7有内存限制吗?
不,Torch没有内存限制,但它需要在分配内存时满足某些条件.如果你看一下THGeneral.c
(错误的来源),你会发现当使用THAllocInternal的分配失败时会引发这个错误.从你的输出我猜你是在Unix系统上我也猜你正在尝试分配大量的内存(但不到1GB).如果要对齐超过5120个字节,THAllocInternal将调用posix_memalign
作为64字节对齐的内存,否则它将调用标准malloc
.也就是说,您看到的错误来自您的操作提供的任何一个函数系统.你必须在那里检查.你也可以尝试用标志DISABLE_POSIX_MEMALIGN重新编译Torch来排除它.