# Installing version 3.1

**URL:** <https://discourse.pymc.io/t/installing-version-3-1/690>\
**Category:** Questions\
**Created:** [January 1, 2018, 12:33pm UTC](https://discourse.pymc.io/t/installing-version-3-1/690 "2018-01-01T12:33:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mullachv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/mullachv/32/400_2.png) [@mullachv](https://discourse.pymc.io/u/mullachv)\
**Post date:** [January 1, 2018, 12:33pm UTC](https://discourse.pymc.io/t/installing-version-3-1/690/1 "2018-01-01T12:33:56Z")

</div>

I am using conda and wish to install pymc3 version 3.1 (not the latest 3.2), on a new machine.  
How do I get version 3.1 installed?

```auto
conda install pymc3

```

Automatically installs v3.2

---

<div class="post-metadata">

**Author:** ![twiecki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/twiecki/32/6930_2.png) [@twiecki](https://discourse.pymc.io/u/twiecki)\
**Post date:** [January 1, 2018, 3:29pm UTC](https://discourse.pymc.io/t/installing-version-3-1/690/2 "2018-01-01T15:29:13Z")

</div>

`conda install pymc3=3.1` should give you that.

May I ask why you want the older version?

---

<div class="post-metadata">

**Author:** ![mullachv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/mullachv/32/400_2.png) [@mullachv](https://discourse.pymc.io/u/mullachv)\
**Post date:** [January 1, 2018, 3:53pm UTC](https://discourse.pymc.io/t/installing-version-3-1/690/3 "2018-01-01T15:53:03Z")

</div>

@twiecki: Hi Thomas,  
I used your sample for [Bayesian Neural Network with lasagne](http://twiecki.github.io/blog/2016/07/05/bayesian-deep-learning/) and wrote some code to classify ‘notMNIST’ dataset. It worked well on my laptop using pymc3 v3.1. And now I tried running this on a new machine it fails when using PyMC3 v3.2 (I think it’s because the code has these deprecated calls):

```auto
pm.variational.advi_minibatch

```

Error Messages:

```auto
Minibatches prepared: 06:42:46
Training started: 06:42:46
Traceback (most recent call last):
  File "bnn_cnn_notMNIST.py", line 288, in <module>
    run_bnn_cnn(args.output)
  File "bnn_cnn_notMNIST.py", line 245, in run_bnn_cnn
    v_params, trace, ppc, y_pred = run_advi(likelihood)
  File "bnn_cnn_notMNIST.py", line 179, in run_advi
    epsilon=1.0
  File "/home/mv333/miniconda2/envs/bnn2.7/lib/python2.7/site-packages/theano/configparser.py", line 117, in res
    return f(*args, **kwargs)
  File "/home/mv333/miniconda2/envs/bnn2.7/lib/python2.7/site-packages/pymc3/variational/advi_minibatch.py", line 478, in advi_minibatch
    _value_error(len(grvs) == len(global_RVs(),
TypeError: 'OrderedDict' object is not callable

```

Relevant code sections:

```auto
    '''
    ADVI sampler
    '''
    def run_advi(likelihood, advi_iters=10000):
        input_var.set_value(X_train[:500, ...])
        target_var.set_value(y_train[:500, ...])
        v_params = pm.variational.advi_minibatch(
            n=advi_iters,
            minibatch_tensors=minibatch_tensors,
            minibatch_RVs=[likelihood],
            minibatches=minibatches,
            total_size=total_size,
            learning_rate=1e-2,
            epsilon=1.0
        )

        trace = pm.variational.sample_vp(v_params, draws=500)

        # Predict on test data
        input_var.set_value(X_test)
        target_var.set_value(y_test)

        ppc = pm.sample_ppc(trace, samples=100)
        y_pred = mode(ppc['out'], axis=0).mode[0, :]

        return v_params, trace, ppc, y_pred

```

---

<div class="post-metadata">

**Author:** ![twiecki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/twiecki/32/6930_2.png) [@twiecki](https://discourse.pymc.io/u/twiecki)\
**Post date:** [January 2, 2018, 12:06pm UTC](https://discourse.pymc.io/t/installing-version-3-1/690/4 "2018-01-02T12:06:15Z")

</div>

Does it work with PyMC 3.1?

---

<div class="post-metadata">

**Author:** ![mullachv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/mullachv/32/400_2.png) [@mullachv](https://discourse.pymc.io/u/mullachv)\
**Post date:** [January 2, 2018, 1:31pm UTC](https://discourse.pymc.io/t/installing-version-3-1/690/5 "2018-01-02T13:31:10Z")

</div>

Yes, it works with pymc3.1 when I use the master branches of theano (1.0.1) and Lasagne (0.2.dev1). Now in the past few weeks, the master branch of theano has changed to (1.0.1+unknown), and so not sure of that combination.  
What I have running now (on the new machine) after where I left off yesterday, is as below.

```auto
$ conda list | grep -i -E "(theano|pymc|lasagne)"
Lasagne 0.2.dev1 <pip>
pymc3 3.2 py27_0 conda-forge
theano 0.9.0 py27_3 conda-forge

```

The code needed to be changed. And now it runs, after the change, however the performance (the fit/ the sampling) is quite poor:

```auto
        approx = pm.fit(advi_iters)
        trace = approx.sample(draws=500)

```

I believe I need further edits to make the code read the mini-batches etc.

---

<div class="post-metadata">

**Author:** ![twiecki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/twiecki/32/6930_2.png) [@twiecki](https://discourse.pymc.io/u/twiecki)\
**Post date:** [January 2, 2018, 11:16pm UTC](https://discourse.pymc.io/t/installing-version-3-1/690/6 "2018-01-02T23:16:11Z")

</div>

Yeah, I started porting the NB to the new VI syntax (using `pm.Minibatch`) but didn’t finish. Let me know if you make some progress and I can update it. There’s also a bug fix for the upcoming 3.3 release that makes VI much faster.
