Theano / Theano

Theano was a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. It is being continued as PyTensor: www.github.com/pymc-devs/pytensor

Home Page:https://www.github.com/pymc-devs/pytensor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A guess of a series weird errors

Nat-Sci opened this issue · comments

Hi,
I planned to deploy my codes from my Mac to Windows platform. I can implement them in my Mac well. But when I deployed them to Windows, I met errors listed below.

Type 1, I mett them when I implement theano.test(), and check_blas.py.

ERROR (theano.gof.opt): Optimization failure due to: constant_folding
ERROR (theano.gof.opt): node: InplaceDimShuffle{x,x}(TensorConstant{0.4})
ERROR (theano.gof.opt): TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
...
...
Exception: ('The following error happened while compiling the node', Gemm{inplace}(<TensorType(float32, matrix)>, TensorConstant{0.8}, <TensorType(float32, matrix)>, <TensorType(float32, matrix)>, TensorConstant{0.4}), '\n', 'Compilation failed (return status=1): The filename, directory name, or volume label syntax is incorrect.\r. ', '[Gemm{inplace}(<TensorType(float32, matrix)>, TensorConstant{0.8}, <TensorType(float32, matrix)>, <TensorType(float32, matrix)>, TensorConstant{0.4})]')

Type 2. during the time when the type1 error takes place, I implemented my codes and met

File "D:\anaconda33\envs\theano\lib\site-packages\theano\gof\cc.py", line 1157, in compile
keep_lock=keep_lock)
File "D:\anaconda33\envs\theano\lib\site-packages\theano\gof\cc.py", line 1624, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "D:\anaconda33\envs\theano\lib\site-packages\theano\gof\cmodule.py", line 1189, in module_from_key
module = lnk.compile_cmodule(location)
File "D:\anaconda33\envs\theano\lib\site-packages\theano\gof\cc.py", line 1527, in compile_cmodule
preargs=preargs)
File "D:\anaconda33\envs\theano\lib\site-packages\theano\gof\cmodule.py", line 2396, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: ('The following error happened while compiling the node', DotModulo(A, s, m, A2, s2, m2), '\n', 'Compilation failed (return status=1): The filename, directory name, or volume label syntax is incorrect.\r. ', '[DotModulo(A, s, m, A2, s2, m2)]')

I tried to locate where is important to this error, I found an interesting issue within my .theanorc.txt file.

[global]
floatX=float32
mode=FAST_RUN
cxx=LD:\anaconda33\envs\theano\MinGW\x86_64-w64-mingw32\bin\g++.exe
force_device=True
device=cpu
[blas]
ldflags=-LD:\anaconda33\Library\bin -lmkl_rt
[gcc]
cxxflags=-LD:\anaconda33\envs\theano\MinGW\x86_64-w64-mingw32\include -LD:\anaconda33\envs\theano\MinGW\x86_64-w64-mingw32\lib -lm
[nvcc]
flags=--cl-version=2015 -D_FORCE_INLINES

If I deleted this line "cxx=LD:\anaconda33\envs\theano\MinGW\x86_64-w64-mingw32\bin\g++.exe". check_blas.py would work well. At the same time, my codes may show the error information :
"ImportError: DLL load failed: The specified procedure could not be found.".
And I can see the output of the check_blas.py.

mkl_info:
libraries = ['mkl_rt']
library_dirs = ['D:/anaconda33/envs/theano\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['D:/anaconda33/envs/theano\Library\include']
blas_mkl_info:
libraries = ['mkl_rt']
library_dirs = ['D:/anaconda33/envs/theano\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['D:/anaconda33/envs/theano\Library\include']
blas_opt_info:
libraries = ['mkl_rt']
library_dirs = ['D:/anaconda33/envs/theano\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['D:/anaconda33/envs/theano\Library\include']
lapack_mkl_info:
libraries = ['mkl_rt']
library_dirs = ['D:/anaconda33/envs/theano\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['D:/anaconda33/envs/theano\Library\include']
lapack_opt_info:
libraries = ['mkl_rt']
library_dirs = ['D:/anaconda33/envs/theano\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['D:/anaconda33/envs/theano\Library\include']
Numpy dot module: numpy.core.multiarray
Numpy location: D:\anaconda33\envs\theano\lib\site-packages\numpy_init_.py
Numpy version: 1.15.4

I am guessing, my codes rely on g++, while g++needs above file locations in mixture format ( Linux and Windows, such as '\' & '/' ). My experiment results show that this issue seems never corrupt cl.exe ( I guess this one is the default setting.)

Can I manually modulate those locations into a uniform format? And HOW?

Many thanks,
NS