Name conflicting in Theano
Asked Answered
G

2

5

I am trying to import theano in a module, but I am getting a traceback:

File "/media/tarun/6A86CA8286CA4DEF/develop/pydy/pydy/codegen/code.py", line 16, in <module>
import theano
File "/usr/local/lib/python2.7/dist-packages/theano/__init__.py", line 44, in <module>
from theano.gof import \
File "/usr/local/lib/python2.7/dist-packages/theano/gof/__init__.py", line 38, in <module>
from theano.gof.cc import \
File "/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py", line 55, in <module>
StrParam(""))
File "/usr/local/lib/python2.7/dist-packages/theano/configparser.py", line 223, in AddConfigVar
  root=newroot, in_c_key=in_c_key)
File "/usr/local/lib/python2.7/dist-packages/theano/configparser.py", line 227, in AddConfigVar
configparam.fullname)
AttributeError: ('This name is already taken', 'gcc.cxxflags')

It seems that there is some name conflict in some config. Can anybody please point me to the same.

Genovevagenre answered 21/8, 2014 at 9:47 Comment(0)
E
2

This error happens because some module, probably theano.gof, is imported twice. Usually, this is because a first call to import theano.gof gets started, registering 'gcc.cxxflags' in the configuration parser a first time, but then raises ImportError, which is catched and ignored. Then, import theano.gof gets called again, tries to register the option again, which raises the exception you get.

Is there any traceback or error message before this one, or something that would give a hint of why the first import failed?

Emblaze answered 30/6, 2015 at 20:44 Comment(2)
It was asked about 10 months ago, and although I have forgotten the case now, but I am pretty sure it was resolved. Thanks anyways.Genovevagenre
@TarunGaba Please post an answer when you find a solution to one of your questions.Juniorjuniority
S
0

I got similar error using when using the jupyter notebook. Restarting kernel solved the issue.

Soule answered 12/12, 2016 at 7:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.