Import theano gives AttributeError: module 'theano' does not have attribute 'gof'

I have python 3. I installed "Theano" bleeding and "Keras" using

pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git 

and

 pip install --upgrade git+git://github.com/Theano/Theano.git 

and

 pip install git+git://github.com/fchollet/keras.git 

But when I try to import Theano, I get the following error:

 AttributeError: module 'theano' has no attribute 'gof' 

I searched the solution on the Internet and achieved nothing ...

This is the part of the code to which I receive the error message (the last line causes an error):

 import sys import numpy as np import pandas as pd from sklearn import preprocessing from keras.models import Sequential 

Since I do not have enough experience with python, I am completely lost and cannot figure out what to do ...

Any help would be appreciated.

+7
python theano keras
source share
2 answers

The problem arises from the broken installation of theano and has nothing to do with ceramics.

This error seems to be due to conflicts in installed versions of theano, also suggested in this answer to the corresponding question.

An easy way to solve the problem without having to paste into the installed version and all you need to use conda as a package manager and let it do the dirty work. If you decide to do this, keep in mind that you should manage all your python modules (although with the latest versions you can install packages using pip supplied with anaconda itself).

See the official documentation on how to install Anaconda. Once anaconda is configured, you can install conda install theano using just conda install theano .

With conda also often convenient to install the packages necessary for a particular application, for example Keras in your case, in an environment isolated from the rest of your python installation, to simplify maintenance. Read the relevant documents to find out how this will work.

+9
source share

The problem seems to be related to your g ++ compiler. Try removing it and running the script again. It will spit a warning indicating performance degradation, but it will still work.

 'Python 3.6.3 |Anaconda custom (32-bit)| (default, Oct 15 2017, 07:29:16) [MSC v.1900 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 6.1.0 -- An enhanced Interactive Python. import theano WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions. ' 
+1
source share

All Articles