我正在使用keras安装anaconda环境,并使用theano后端。但我不能让西亚诺去工作。这是我所做的事,也是事后指出的错误。
步骤1:下载最新版本的anaconda,然后通过bash 3-5.0.1- linux -x86_64.sh在Linux中安装
步骤2:conda安装-c conda-forge,它安装keras 2.0.9
这也安装了theano 1.0.1,如下所示:
The following NEW packages will be INSTALLED:
keras: 2.0.9-py36_0 conda-forge
lib
我正在运行 kaggle_otto_nn.py of Keras,后端为theano。当我设置cnmem=1时,会出现以下错误:
cliu@cliu-ubuntu:keras-examples$ THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32,lib.cnmem=1 python kaggle_otto_nn.py
Using Theano backend.
ERROR (theano.sandbox.cuda): ERROR: Not using GPU. Initialisation of device gpu failed:
in
我正在使用Theano在Linux机器上训练我的模型。代码在CPU上运行良好,但当我切换回同一台计算机:AttributeError: 'TensorVariable' object has no attribute 'get_value'中的GPU时,出现了一个错误。
我发现一个由numpy数组构造的参数不是一个共享变量,而是一个普通的TensorVariable,如果我在GPU上运行它。但是CPU中没有这样的问题。我在CPU上遇到了相同的问题,我通过将numpy数组转换为相同的theano.config.floatX浮动类型来修复它。但我不知道怎么解决这个问
我在linux上使用anaconda,我已经安装了相关的包。我正在尝试学习theano,为了简单起见,我想运行以下代码
from sympy.printing.theanocode import theano_function
import sympy as sp
import numpy as np
x, y, z = sp.symbols('x y z')
f = sp.sin(x)*sp.cos(y)*sp.sin(z) + sp.sin(4*(x - y**2*sp.sin(z)))
xg, yg, zg = np.mg
您可以在这个临时文件中找到C代码:
/tmp/theano_compilation_error_7_ntcw7n
Traceback (most recent call last):
File "/home/vaishnavnimkar/.local/lib/python3.7/site-packages/theano/gof/lazylinker_c.py", line 81, in <module>
actual_version, force_compile, _need_reload))
ImportError: Version check of
正在尝试运行docker命令:
nvidia-docker run -d -p 8888:8888 -e PASSWORD="123abcChangeThis" theano_secure start-notebook.sh
# Then open your browser at http://HOST:8888
摘自
返回错误:
Error: image library/theano_secure:latest not found
是否显示theano_secure映像当前不可用?
搜索theano_secure:
$ nvidia-docker search theano
我刚刚开始使用Theano,我想知道为什么第一次在gpu上创建共享变量似乎会影响numpy的随机数生成器。有时,这个初始的创建似乎提前了随机数生成器。
在这段代码中,我探索了以下测试用例:
import numpy
import theano
from theano.compile.sharedvalue import shared
import theano.sandbox.cuda as tcn
def make_cpu_shared():
#Create, but don't return/use shared variable on cpu
shared(t
当我尝试编译keras文档中的示例时,我得到了以下错误。
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
ERROR (
成功安装theano之后,我使用:
import theano
它只是给我一个警告:
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will
default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano fl
你知道怎么解决这个问题吗?
mona@pascal:~$ python3
Python 3.4.3 (default, Nov 17 2016, 01:08:31)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keras
Using TensorFlow backend.
I tensorflow/stream_executor/dso_loader.
我尝试在pymc3中运行一个在多级模型中执行点积时利用theano.dot的模型。但是,当我尝试导入theano时,我得到:
python model.py
... // there's a huge output that's looks to be a file
Problem occurred during compilation with the command line below:
g++ -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-string
在经历了一系列的痛苦之后,我在一台带有Radeon HD 5450 (Cedar)显卡的机器上安装了Theano。
现在,考虑下面的代码。
import numpy
import theano
import theano.tensor as T
rng = numpy.random
N = 400 #number of samples
feats = 784 #dimensionality of features
D = (rng.randn(N, feats), rng.randint(size=N, low=0, high=2))
training_steps =
在尝试使用theano和千层面训练深度卷积神经网络时,我遇到了一些性能问题。我做了一些实验来调查它们来自哪里。我发现,从主内存向GPU加载图像批次需要很长时间。下面是一个说明问题的最小示例。它只是计算批量大小为1,2,4,8,16,…的图像的theano恒等函数所需的时间。我正在处理大小为448x448的RGB图像。
import numpy as np
import theano
import theano.tensor as T
import time
var = T.ftensor4('inputs')
f = theano.function([var], var)