2016-04-10 71 views
2

我剛剛安裝了Torch7 as per the instructions。然而,我無法端口的包通過命令行解釋:將包導入火炬時出錯

kamransiquisMBP:~ khsiddiqui$ th 

    ______    __ | Torch7           
/_ __/__ ________// | Scientific computing for Lua. 
///_ \/ __/ __/ _ \ | Type ? for help         
/_/ \___/_/ \__/_//_/ | https://github.com/torch   
          | http://torch.ch     

    th> require "nn" 
    ...rs/khsiddiqui/torch/install/share/lua/5.1/trepl/init.lua:384: 
    ...rs/khsiddiqui/orch/install/share/lua/5.1/trepl/init.lua:384: 
    loop or previous error loading module 'torch' 
    stack traceback: 
     [C]: in function 'error 
     ...rs/khsiddiqui/torch/install/share/lua/5.1/trepl/init.lua:384: 
     in function 'require' [string "_RESULT={require "nn"}"]:1: in main chunk 
     [C]: in function 'xpcall' 
     ...rs/khsiddiqui/torch/install/share/lua/5.1/trepl/init.lua:651: 
     in function 'real'...iqui/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: 
     in main chunk 
     [C]: at 0x010fc1cd00  
    th> 1 + 1 
    2 

外解釋的,(只是在命令行),我跑的命令luarocks install nn,但上述同樣的錯誤依然存在。

很想讓Torch7啓動並運行!


嗨,@deltheil ...

kamransiquisMBP:~ khsiddiqui$ luajit -ltorch 
luajit: /usr/local/share/lua/5.1/torch/init.lua:11: cannot load 
'/usr/local/lib/lua/5.1/libtorch.so' 
stack traceback: 
    [C]: in function 'require' 
    /usr/local/share/lua/5.1/torch/init.lua:11: in main chunk 
    [C]: at 0x010a587dd0 
    [C]: at 0x010a50bd00 

運行以下後luajit ...

th> ok, err = pcall(require, 'libtorch') 
th> print(ok, err) 
false error loading module 'lib torch' from file  
'/usr/local/lib/lua/5.1/libtorch.so': 
dlopen(/usr/local/lib/lua/5.1/libtorch.so, 
6): Library not loaded: libmkl_intel_lp64.dylib 
    Referenced from: /Users/khsiddiqui/torch/install/lib/libTH.dylib 
    Reason: image not found 
+0

如果你做了'luajit -ltorch',你會得到什麼 – deltheil

+0

我更新了q ...我感謝幫助。 –

+0

嗯......你應該仔細檢查'。/ install.sh'(官方入門指南中的主要安裝腳本)的輸出(日誌)。如果你做了'luajit'然後'ok,err = pcall(require,'libtorch')''和print(ok,err)'',你會得到什麼? – deltheil

回答

5

由於是@deltheil的援助!

As per the instructions on this page,什麼工作對我來說(在Mac OSX)是:

  1. 定位和刪除文件./pkg/torch/lib/TH/cmake/FindMKL.cmake ...
  2. 做一個乾淨的運行./clean.sh; ./install.sh安裝...

之後,火炬按預期運行:-)。當我們說話時,我是機器學習!