I created a conda envirinment with python 3.9 and Installed theano 1.0.5. But when I write this simple program, I encounter many errors. This is my code:
import theano
from theano import tensor as T
x = T.vector('x')
W = T.matrix('W')
b = T.vector('b')
dot = T.dot(x, W)
out = T.nnet.sigmoid(dot + b)
and this is my errors:
F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\scalar\basic.py:2324: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
self.ctor = getattr(np, o_type.dtype)
Traceback (most recent call last):
File "f:/Projects/Python/theanoTutorial/firstExample.py", line 1, in <module>
import theano
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\__init__.py", line 124, in <module>
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\scan_module\__init__.py", line 41, in <module>
from theano.scan_module import scan_opt
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\scan_module\scan_opt.py", line 60, in <module>
from theano import tensor, scalar
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\tensor\__init__.py", line 8, in <module>
from theano.tensor.basic import *
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\tensor\basic.py", line 20, in <module>
from theano.scalar import int32 as int32_t
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\scalar\__init__.py", line 3, in <module>
from .basic import *
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\scalar\basic.py", line 2371, in <module>
convert_to_bool = Cast(bool, name='convert_to_bool')
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\theano\scalar\basic.py", line 2324, in __init__
self.ctor = getattr(np, o_type.dtype)
File "F:\Projects\Python\Environments\condaTheano\lib\site-packages\numpy\__init__.py", line 305, in __getattr__
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
What's the problem?
I think there are some conflicts or incompatibility between python version and packages. But I don't know what exactly it is.
I tried with python 3.8 and theano 1.0.4, but anything didn't change. Also I changed the versions of some packages like mkl, but nothing changed. Thanks.