Frage

from theano.tensor import stacklists, scalars, matrices

from theano import function

a, b, c, d = scalars('abcd')

X = stacklists([[a, b], [c, d]])   
f = function([a, b, c, d], X)
f(1, 2, 3, 4)

this is my program. i am getting following error.can anybody help

ImportError                               Traceback (most recent call last)
<ipython-input-17-e4e1f4f75320> in <module>()
----> 1 from theano.tensor import stacklists, scalars, matrices

      2 from theano import function

      3 a, b, c, d = scalars('abcd')
      4 X = stacklists([[a, b], [c, d]])
      5 f = function([a, b, c, d], X)

ImportError: cannot import name stacklists
War es hilfreich?

Lösung

You probably have an old version of Theano; stacklist was recently introduced/renamed (a month ago). Sou you should update to the latest/dev version. If you want to stay in your version try importing tensor_of_scalars instead of stacklist.

To update follow the instructions here.

Andere Tipps

This error can be caused by one of two things.

The first one is pretty obvious: does theano.tensor define a name stacklists? Should it be, for example, stacklist?

Secondly, it can happen if something else you're importing has already imported the name in a way where doing so again would cause a circular reference. The second would have to be fixed by looking at your source files.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top