2016-11-22 1 views
-1

Ich habe versucht, theano.tensor in meinem Code zu importieren. Ich habe theano.tensor vorher benutzt. Alle meine früheren Code-Import theano.tensor funktioniert perfekt in meinem Computer. Jetzt versuche ich ein anderes Skript zu schreiben, das den Tensor von theano importiert und ich bekomme die folgende Ausnahme.Theano Tensor Importfehler

Traceback (most recent call last): 
    File "code.py", line 2, in <module> 
    import theano.tensor as T 
    File "/anaconda3/lib/python3.5/site-packages/theano/__init__.py", line 52, in <module> 
    from theano.gof import (
    File "/anaconda3/lib/python3.5/site-packages/theano/gof/__init__.py", line 56, in <module> 
    from theano.gof.opt import (
    File "/anaconda3/lib/python3.5/site-packages/theano/gof/opt.py", line 11, in <module> 
    import pdb 
    File "/anaconda3/lib/python3.5/pdb.py", line 75, in <module> 
    import code 
    File "/localtmp/saikat/CovInfo/Closure/code.py", line 2, in <module> 
    import theano.tensor as T 
    File "/anaconda3/lib/python3.5/site-packages/theano/tensor/__init__.py", line 6, in <module> 
    from theano.tensor.basic import * 
    File "/anaconda3/lib/python3.5/site-packages/theano/tensor/basic.py", line 17, in <module> 
    from theano.tensor import elemwise 
    File "/anaconda3/lib/python3.5/site-packages/theano/tensor/elemwise.py", line 13, in <module> 
    from theano import scalar 
    File "/anaconda3/lib/python3.5/site-packages/theano/scalar/__init__.py", line 2, in <module> 
    from .basic import * 
    File "/anaconda3/lib/python3.5/site-packages/theano/scalar/basic.py", line 25, in <module> 
    from theano import gof, printing 
    File "/anaconda3/lib/python3.5/site-packages/theano/printing.py", line 22, in <module> 
    from theano.compile import Function, debugmode, SharedVariable 
    File "/anaconda3/lib/python3.5/site-packages/theano/compile/__init__.py", line 9, in <module> 
    from theano.compile.function_module import * 
    File "/anaconda3/lib/python3.5/site-packages/theano/compile/function_module.py", line 22, in <module> 
    import theano.compile.mode 
    File "/anaconda3/lib/python3.5/site-packages/theano/compile/mode.py", line 77, in <module> 
    OPT_NONE = gof.Query(include=[], exclude=exclude) 
AttributeError: module 'theano.gof' has no attribute 'Query' 

Ich kann keinen plausiblen Grund für diese Ausnahme finden.

+0

Wie lautet der Dateiname Ihres Skripts? –

+0

'code.py' was hat das mit irgendetwas zu tun? – Saikat

Antwort

1

Ich denke, ich habe dein Problem. Siehe im Fehlerprotokoll:

File "/anaconda3/lib/python3.5/pdb.py", line 75, in <module> 
    import code 

Ich glaube, es ein anderes Skript code.py in Theano genannt ist, die sich von pdb.py aufgerufen wird, wenn Python-Interpreter Skript ausführt, die auch als code.py gestattet. Ich vermute, Python-Interpreter vermischen diese beiden Skripte und führen die falsche aus! Sie können den Dateinamen ändern und prüfen, ob der Fehler verschwindet oder nicht.

+0

Danke @ Wasi-Ahmad – Saikat

Verwandte Themen