2017-03-10 2 views
0

Ich habe Probleme, PYMC3 für die korrekte Installation unter Windows zu installieren. Ich habe versucht, das Anaconda-Paket über conda install -c conda-forge pymc3 und in einem virtualenv nur mit pip wie in der Dokumentation zu verwenden.Verwenden von PYMC3 unter Windows 10 - Theano kann den Namen 'floatX' nicht importieren

Es scheint zu installieren, ok, aber schlägt fehl, wenn eine import pymc3 mit dem folgenden Fehler ausgeführt wird. Die Forschung legt nahe, dass es einige Abhängigkeiten geben kann, die übersehen werden.

>>> import pymc3 
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL: 
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29 

ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check your nvcc installation and try again. 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\__init__.py", line 8, in <module> 
    from .sampling import * 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\sampling.py", line 11, in <module> 
    from .step_methods import (NUTS, HamiltonianMC, Metropolis, BinaryMetropolis, 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\__init__.py", line 3, in <module> 
    from .hmc import HamiltonianMC 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\hmc\__init__.py", line 1, in <module> 
    from .hmc import HamiltonianMC 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\hmc\hmc.py", line 7, in <module> 
    from .base_hmc import BaseHMC 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\hmc\base_hmc.py", line 2, in <module> 
    from .trajectory import get_theano_hamiltonian_functions 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\hmc\trajectory.py", line 3, in <module> 
    from pymc3.theanof import join_nonshared_inputs, gradient, CallableTensor, floatX 
ImportError: cannot import name 'floatX' 

Ich kann nicht viel da draußen über dieses floatx Paket.

Scheint eine Windows-Sache zu sein - wie es installiert und läuft keine Probleme auf meiner alten Ubuntu-Box (mit Anaconda).

Jede Hilfe dankbar erhalten!

BEARBEITEN: Treten Sie näher. Aus irgendeinem Grund hatte ich den Pfad zum nvcc-Compiler falsch. Also, wenn Sie die gleiche Prüfung haben, dass Sie den vollständigen Pfad einschließlich "\ bin" in Ihrem Umgebungsweg haben. Wenn Sie eine Änderung vornehmen, vergessen Sie nicht, neu zu starten.

Jetzt bekomme ich eine Fehlermeldung:

>>> import pymc3 
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL: 
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29 

Using gpu device 0: GeForce GTX 960M (CNMeM is disabled, cuDNN not available) 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\__init__.py", line 4, in <module> 
    from .distributions import * 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\distributions\__init__.py", line 1, in <module> 
    from . import timeseries 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\distributions\timeseries.py", line 1, in <module> 
    import theano.tensor as tt 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\__init__.py", line 116, in <module> 
    theano.sandbox.cuda.tests.test_driver.test_nvidia_driver1() 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\sandbox\cuda\tests\test_driver.py", line 32, in test_nvidia_driver1 
    profile=False) 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\compile\function.py", line 326, in function 
    output_keys=output_keys) 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\compile\pfunc.py", line 486, in pfunc 
    output_keys=output_keys) 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\compile\function_module.py", line 1795, in orig_function 
    defaults) 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\compile\function_module.py", line 1661, in create 
    input_storage=input_storage_lists, storage_map=storage_map) 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\link.py", line 699, in make_thunk 
    storage_map=storage_map)[:3] 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\vm.py", line 1098, in make_all 
    self.updated_vars, 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\vm.py", line 952, in make_vm 
    vm = CVM(
NameError: name 'CVM' is not defined 
>>> 

Diesen mich mit dem letzten Beitrag festen hier: https://groups.google.com/forum/#!msg/theano-users/JoTu61_MTLk/4ZzsVyaOf2kJ. Aber jetzt mit einem Fehler stecken:

>>> import pymc3 
Traceback (most recent call last): 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 306, in <module> 
    from cutils_ext.cutils_ext import * # noqa 
ImportError: No module named 'cutils_ext.cutils_ext' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 317, in <module> 
    from cutils_ext.cutils_ext import * # noqa 
ImportError: No module named 'cutils_ext.cutils_ext' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\__init__.py", line 4, in <module> 
    from .distributions import * 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\distributions\__init__.py", line 1, in <module> 
    from . import timeseries 
    File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\distributions\timeseries.py", line 1, in <module> 
    import theano.tensor as tt 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\__init__.py", line 80, in <module> 
    from theano.scan_module import (scan, map, reduce, foldl, foldr, clone, 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\scan_module\__init__.py", line 41, in <module> 
    from theano.scan_module import scan_opt 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py", line 60, in <module> 
    from theano import tensor, scalar 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\tensor\__init__.py", line 9, in <module> 
    from theano.tensor.subtensor import * 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\tensor\subtensor.py", line 26, in <module> 
    import theano.gof.cutils # needed to import cutils_ext 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 320, in <module> 
    compile_cutils() 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 285, in compile_cutils 
    preargs=args) 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2313, in compile_str 
    return dlimport(lib_filename) 
    File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 302, in dlimport 
    rval = __import__(module_name, {}, {}, [module_name]) 
ImportError: DLL load failed: The specified procedure could not be found. 
>>> 

Die Untersuchung geht weiter! Vielleicht ist es an der Zeit, Windows zu deinstallieren und zu Linux zu wechseln!

EDIT2: Ich wechselte zu einer Python 2.7 Umgebung und es scheint in Ordnung zu arbeiten. Musste http://mingw.org/ installieren, aber danach alles in Ordnung.

Wäre schön, es in 3.6 obwohl zu arbeiten. Gedanken an jemanden?

+0

Die ersten Fehlermeldungen sehen ein bisschen wie Sie zwei verschiedene Versionen pymc3 miteinander, dass irgendwie Chaos installiert haben könnte. floatX ist kein Paket, es ist eine Funktion in pymc3.theanof (etwa 2 Monate alt). Aus irgendeinem Grund scheint auch das gpu-Backend in theano aktiviert zu sein. Vielleicht versuchen Sie, das CPU-Backend zuerst zum Laufen zu bringen. – aseyboldt

Antwort

2

Ok, ich schaffte es, eine Installation zusammen zu cobble.

Ich hatte kein Glück mit der Abhängigkeitsverwaltung usw. conda install -c conda-forge pymc3, und ich konnte nicht sicher sein, wenn es Probleme mit Standorten/Pfade zu Compilern usw. gab Also habe ich eine Neuinstallation von Anfang an.

Ich ging für Anaconda3 (anstatt 2) und es hat gut funktioniert.

1) Ich folgte der Umgebungseinstellung hierbis ich an den Punkt der Installation von Theano kam. Aber anstelle der vorgeschlagenen Version habe ich das neueste mit conda install -c rdonnelly Theano von https://github.com/nouiz vorgeschlagen installiert. Dies ist eine schöne solide Umgebung - und ich empfehle das msys-Tool - ich hatte es vorher noch nicht benutzt.

Das Testskript im Philferriere Guide ist eine gute Möglichkeit, Funktion/Performance zu testen.

2) Dann richte ich pymc3 mit pip install pymc3 ein, wie sie hier vorschlagen https://github.com/pymc-devs/pymc3. aber nicht die neueste Version auf Git.

Hoffe jemand findet das nützlich.

Refs: https://github.com/Theano/Theano/issues/5348

Verwandte Themen