This works:
import pymc3 as pm
if pm.version == ‘4.0’:
import aesara as th # efficent tensors
import aesara.tensor as tt # tensor control
else:
import theano as th # efficent tensors
import theano.tensor as tt # tensor control
I wanted it to work on my mac, but clang is giving me fits, so I thought I would try a container.
I found this:
but it has not been updated in a long time and the base container’s python is now v3.9. I think Pymc is just tested on v3.8 correct?
I have figured out that most releases of Pymc have a dependencies complete with versions… I just can’t figure out if I want a functioning full stack what I need to do. What is the recommended full stack and base python that I need on an ubuntu image? can we use miniconda or something like it rather than anaconda?
ok, so I did this:
pip install git+https://github.com/aesara-devs/aesara
that got me further, it looks like everything on this page now works:
I do have the following warning:
WARNING (aesara.configdefaults): g++ not detected ! Aesara will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Aesara flags cxx to an empty string.
WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
I am also struggling with creating a docker container that has pymc3 installed correctly (such that the warning Using NumPy C-API based implementation for BLAS functions does not appear).
If anyone has succeeded, please post your docker file!
The docs strongly recommend using conda, so I tried this:
FROM continuumio/anaconda-pkg-build
RUN conda install -c conda-forge pymc3 mkl-service
RUN conda update pymc3
but then pymc3 raises these 2 warnings:
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
Starting with a basic python image and using pip:
FROM python:3.9
RUN apt-get update
RUN apt-get -y install build-essential
RUN pip install pymc3==3.11.4
results in just the 2nd warning:
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
…and seems to work just fine. @twiecki says this warning is ok to ignore:
That said, if anyone has a recipe for a better setup, please let me know.
I noticed that switching to “blas” from “openblas” on my linux system made a difference at some point; maybe worth a try? It might at least help some of the warnings.