Cannot import name ‘MRG_RandomStreams’ from ‘theano.sandbox.rng_mrg’

  lasagne, python, python-3.x, theano

I tried importing Lasagne in my code which is as follows:

from __future__ import print_function
import sys
import os
import time
import string
import random
import pickle
import numpy as np
import theano
import theano.tensor as T
import lasagne

But on running the file I keep getting the following error:

  File "main_cifar_100_theano.py", line 12, in <module>
    import lasagne
  File "/usr/local/lib/python3.7/dist-packages/lasagne/__init__.py", line 19, in <module>
    from . import layers
  File "/usr/local/lib/python3.7/dist-packages/lasagne/layers/__init__.py", line 5, in <module>
    from .noise import *
  File "/usr/local/lib/python3.7/dist-packages/lasagne/layers/noise.py", line 6, in <module>
    from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
ImportError: cannot import name 'MRG_RandomStreams' from 'theano.sandbox.rng_mrg' (/usr/local/lib/python3.7/dist-packages/theano/sandbox/rng_mrg.py)

Please help me resolve this issue.

Source: Python-3x Questions

LEAVE A COMMENT