提交 ecc95982 authored 作者: scottsievert's avatar scottsievert

clarifies Python 3 usage in documentation

上级 a5f75aa3
...@@ -5,10 +5,15 @@ ...@@ -5,10 +5,15 @@
========================== ==========================
Frequently Asked Questions Frequently Asked Questions
========================== ==========================
Does Theano support Python 3?
------------------------------
We support both Python 2 >= 2.6 and Python 3 >= 3.3.
TypeError: object of type 'TensorVariable' has no len() TypeError: object of type 'TensorVariable' has no len()
------------------------------------------------------- -------------------------------------------------------
If you receive the following error, it is because the Python function *__len__* cannot If you receive the following error, it is because the Python function *__len__* cannot
be implemented on Theano variables: be implemented on Theano variables:
.. code-block:: python .. code-block:: python
...@@ -17,7 +22,7 @@ be implemented on Theano variables: ...@@ -17,7 +22,7 @@ be implemented on Theano variables:
Python requires that *__len__* returns an integer, yet it cannot be done as Theano's variables are symbolic. However, `var.shape[0]` can be used as a workaround. Python requires that *__len__* returns an integer, yet it cannot be done as Theano's variables are symbolic. However, `var.shape[0]` can be used as a workaround.
This error message cannot be made more explicit because the relevant aspects of Python's This error message cannot be made more explicit because the relevant aspects of Python's
internals cannot be modified. internals cannot be modified.
...@@ -64,10 +69,10 @@ compilation but it will also use more memory because ...@@ -64,10 +69,10 @@ compilation but it will also use more memory because
in a trade off between speed of compilation and memory usage. in a trade off between speed of compilation and memory usage.
Theano flag `reoptimize_unpickled_function` controls if an unpickled theano function Theano flag `reoptimize_unpickled_function` controls if an unpickled theano function
should reoptimize its graph or not. Theano users can use the standard python pickle should reoptimize its graph or not. Theano users can use the standard python pickle
tools to save a compiled theano function. When pickling, both graph before and tools to save a compiled theano function. When pickling, both graph before and
after the optimization are saved, including shared variables. When set to True, after the optimization are saved, including shared variables. When set to True,
the graph is reoptimized when being unpickled. Otherwise, skip the graph optimization the graph is reoptimized when being unpickled. Otherwise, skip the graph optimization
and use directly the optimized graph from the pickled file. After Theano 0.7, and use directly the optimized graph from the pickled file. After Theano 0.7,
the default changed to False. the default changed to False.
...@@ -197,7 +202,7 @@ We try to list in this `wiki page <https://github.com/Theano/Theano/wiki/Related ...@@ -197,7 +202,7 @@ We try to list in this `wiki page <https://github.com/Theano/Theano/wiki/Related
-------------------------------- --------------------------------
Theano offers a good amount of flexibility, but has some limitations too. Theano offers a good amount of flexibility, but has some limitations too.
You must answer for yourself the following question: How can my algorithm be cleverly written You must answer for yourself the following question: How can my algorithm be cleverly written
so as to make the most of what Theano can do? so as to make the most of what Theano can do?
Here is a list of some of the known limitations: Here is a list of some of the known limitations:
......
...@@ -20,11 +20,11 @@ instructions below for detailed installation steps): ...@@ -20,11 +20,11 @@ instructions below for detailed installation steps):
We develop mainly on 64-bit Linux machines. other architectures are We develop mainly on 64-bit Linux machines. other architectures are
not well-tested. not well-tested.
Python_ >= 2.6 Python_ 2 >= 2.6 or Python_ 3 >= 3.3
The development package (``python-dev`` or ``python-devel`` The development package (``python-dev`` or ``python-devel``
on most Linux distributions) is recommended (see just below). on most Linux distributions) is recommended (see just below).
Python 2.4 was supported up to and including the release 0.6. Python 2.4 was supported up to and including the release 0.6.
Python 3 is supported via 2to3 only, starting from 3.3. Python 3 is supported past the 3.3 release.
``g++``, ``python-dev`` ``g++``, ``python-dev``
Not technically required but *highly* recommended, in order to compile Not technically required but *highly* recommended, in order to compile
...@@ -147,7 +147,13 @@ by typing ...@@ -147,7 +147,13 @@ by typing
pip install Theano pip install Theano
You may need to add ``sudo`` before this command to install into your This should work under Python 2 or Python 3. To test, run
.. code-block:: bash
nosetests theano
You may need to add ``sudo`` before the ``pip`` command to install into your
system's ``site-packages`` directory. If you do not have administrator access system's ``site-packages`` directory. If you do not have administrator access
to your machine, you can install Theano locally (to ~/.local) using to your machine, you can install Theano locally (to ~/.local) using
...@@ -226,7 +232,7 @@ Bleeding-edge install instructions ...@@ -226,7 +232,7 @@ Bleeding-edge install instructions
If you are a developer of Theano, then check out the :ref:`dev_start_guide`. If you are a developer of Theano, then check out the :ref:`dev_start_guide`.
If you want the bleeding-edge without developing the code you can use pip for If you want the bleeding-edge without developing the code you can use pip for
this with the command line below. Note that it will also try to install Theano's dependencies this with the command line below. Note that it will also try to install Theano's dependencies
(like NumPy and SciPy), but not upgrade them. If you wish to upgrade them, (like NumPy and SciPy), but not upgrade them. If you wish to upgrade them,
remove the ``--no-deps`` switch to it, but go see a previous warning before doing this. remove the ``--no-deps`` switch to it, but go see a previous warning before doing this.
...@@ -255,11 +261,6 @@ From here, the easiest way to get started is (this requires setuptools_ or distr ...@@ -255,11 +261,6 @@ From here, the easiest way to get started is (this requires setuptools_ or distr
cd Theano cd Theano
python setup.py develop python setup.py develop
.. note::
"python setup.py develop ..." does not work on Python 3 as it does not call
the converter from Python 2 code to Python 3 code.
This will install a ``.pth`` file in your ``site-packages`` directory that This will install a ``.pth`` file in your ``site-packages`` directory that
tells Python where to look for your Theano installation (i.e. in the tells Python where to look for your Theano installation (i.e. in the
directory your just checked out of Github). Using ``develop`` mode is directory your just checked out of Github). Using ``develop`` mode is
......
...@@ -182,6 +182,7 @@ Here is the state of that vision as of December 3th, 2013 (after Theano release ...@@ -182,6 +182,7 @@ Here is the state of that vision as of December 3th, 2013 (after Theano release
* Possible implementation note: allow Theano Variable in the fgraph to * Possible implementation note: allow Theano Variable in the fgraph to
have more than 1 owner. have more than 1 owner.
* We support Python 2 and Python 3.
* We have a CUDA backend for tensors of type `float32` only. * We have a CUDA backend for tensors of type `float32` only.
* Efforts have begun towards a generic GPU ndarray (GPU tensor) (started in the * Efforts have begun towards a generic GPU ndarray (GPU tensor) (started in the
`libgpuarray <https://github.com/Theano/libgpuarray>`_ project) `libgpuarray <https://github.com/Theano/libgpuarray>`_ project)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论