我在測試安裝的deep learning工具theano。按照官網Baby Steps - Algebra一步步輸入。
>>> import theano.tensor as T
>>> from theano import function
>>> x = T.dscalar('x')
>>> y = T.dscalar('y')
>>> z = x + y
>>> f = function([x, y], z)
import theano沒有問題,定義x, y, z都沒問題。最后一步f = function([x, y], z)的時候報錯了。
錯誤是“nvcc fatal : Cannot find compiler 'cl.exe' in PATH” 說是缺少cl.exe,不知道這個文件做什么,用Google搜索了一下。看到有人說cl.exe在類似“C:\Program Files\Microsoft Visual Studio 10.0\VC\bin”的目錄下。找了找果然有,把這個路徑加入環境變量。
重新測試,原來那個報錯不再有了,又出來一個新問題,不過好在不影響最后結果。。。
>>> x = T.dsc >>> y = T.dsc >>> z = x + y >>> f = funct DEBUG: nvcc STDOUT mod.cu ................................. >>> f(2, 3) array(5.0)
