WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions


#1

Ok. It took me a few hours to administer a bandade fix, so I’m sharing in case this happens to anyone else, but it’s not a good long-term solution.

when I import pymc3 as pm, it gave a warning:

WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions

I opened Anaconda prompt and installed theano using conda (pip install didn’t solve the issue):

conda install theano

Then I restarted jupyter and imported pym3 again and got this Error:

To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.

So I did as instructed on the internet (link) and opened Anaconda Prompt, and typed:

set MKL_THREADING_LAYER=GNU

Then I ran Jupyter Notebook through the same Anaconda prompt, by typing in:

jupyter notebook

Then, when I ran NUTS:

with model:
    mean = pm.Normal('class_A_mean', mu, sd=sigma)
    [blabla]
    [blabla]
    trace = pm.sample(5000, njobs=2)

I got the following error:

name ‘CVM’ is not defined

So I did what this link suggested and deleted the theano directory in:

C:\Users\username\AppData\Local\Theano directory.

Everything works and I got a beautiful result. However, every day I want to run the same script, I have to initialize anaconda prompt, insert “set MKL_THREADING_LAYER=GNU”, and delete the theano directory in my Local drive.
Is there a way around this?

I saw your post, jupenglao, referring to the “MKL_THREADING_LAYER=GNU” error but couldn’t understand how it was solved. And there must be a better way than deleting the theano folder before I run this script every time.


#2

I was mistaken in the reply - but now this is truely fixed on theano master https://github.com/Theano/Theano/pull/6589
So there shouldnt be any problem in the next release


#3

thanks jupenglao. Does this mean that i have to wait for theano’s next release to upgrade theano and have this solved? If theano is closing, will they still be making new releases?


#4

Yes they are still making bug fix release.