theano

联想z470安装cuda toolkit 7.5过程

点点圈 提交于 2019-11-26 22:09:18
我安装的系统是ubuntu kylin 14.04,ubuntu 14.04也差不多一样.我的目的是让GPU能跑一些机器学习以及深度学习的框架,如theano 1,卸载掉与nvidia相关的驱动以及旧版的cuda相关程序 sudo apt-get remove --purge nvidia* cuda* 2,到 cuda官网 下载新的cuda toolkit版本,我下的deb版的,也可以下run版的,我装的是时候是7.5版(2015.12.14.),你可以试着进入字符界面(ctrl+alt+F1),安装,也可以直接在终端安装主,我是选择前者, sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb 安装好仓库之后,就可以更新你的本地仓库。 sudo apt-get update 最后开始安装cuda以及显卡驱动 sudo apt-get install cuda 安装完后加入环境变量,这个有好几种方法,我选择在本用户目录下安装,vim ~/.bashrc,在后面加入 $ export PATH=/usr/local/cuda-7.5/bin:$PATH $ export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH 设置完毕之后

the computational graph needed to compute the outputs报错解决

与世无争的帅哥 提交于 2019-11-26 20:45:36
theano是老古董了,但是鉴于既然碰到了、解决了,那就记录下来吧,方便后来者. 环境: ubuntu18.10 jupyter3.6(终端运行下面的代码的话,会无法显示图形的) #--------------------------------------------------- 完整的故障代码如下: import theano import numpy as np import theano.tensor as T from IPython.display import Image from IPython.display import display W = T.dmatrix('W') V = T.dmatrix('V') x = T.dvector('x') #------------------------------------------------------- f = T.dot(x,W) VJ = T.Lop(f,W,V) result= theano.function([V,W,x], VJ) display(Image(theano.printing.pydotprint(result,return_image=True, var_with_name_simple=True))) 报错如下: UnusedInputError: theano

how to setup cuDnn with theano on Windows 7 64 bit

烈酒焚心 提交于 2019-11-26 19:02:40
I have installed Theano framework and enabled CUDA on my machine, however when I "import theano" in my python console, I got the following message: >>> import theano Using gpu device 0: GeForce GTX 950 (CNMeM is disabled, CuDNN not available) Now that "CuDNN not available", I downloaded cuDnn from Nvidia website. I also updated 'path' in environment, and added 'optimizer_including=cudnn' in '.theanorc.txt' config file. Then, I tried again, but failed, with: >>> import theano Using gpu device 0: GeForce GTX 950 (CNMeM is disabled, CuDNN not available) Traceback (most recent call last): File "

Keras: “RuntimeError: Failed to import pydot.” after installing graphviz and pydot

偶尔善良 提交于 2019-11-26 18:21:22
问题 I'm using Anaconda Python 2.7 on windows 10 I was planning on doing Keras visualization so (whilst spyder was open) I opened the Anaconda command prompt and pip installed graphviz and pydot. Now when I try run the following: from keras.models import Sequential or any sort of "from keras." , I get the error: ImportError: cannot import name gof I have uninstalled and reinstalled Keras, Graphviz and pydot. i am using the development version of theano. I cannot find a fix. P.S If I uninstall

How do I install Keras and Theano in Anaconda Python on Windows?

蹲街弑〆低调 提交于 2019-11-26 18:11:04
I am trying to work on neural networks in Python using the following Keras packages: from keras.utils import np_utils from keras.layers.core import Dense, Activation, Dropout from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.optimizers import SGD But, I am getting the following error: 15 import theano ---> 16 from theano import gof 17 from theano.compat.python2x import partial 18 import theano.compile.mode ImportError: cannot import name gof Installing installed

How to get reproducible results in keras

只愿长相守 提交于 2019-11-26 15:19:17
I get different results (test accuracy) every time I run the imdb_lstm.py example from Keras framework ( https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py ) The code contains np.random.seed(1337) in the top, before any keras imports. It should prevent it from generating different numbers for every run. What am I missing? UPDATE: How to repro: Install Keras ( http://keras.io/ ) Execute https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py a few times. It will train the model and output test accuracy. Expected result: Test accuracy is the same on every run. Actual

NaN loss when training regression network

吃可爱长大的小学妹 提交于 2019-11-26 15:13:54
问题 I have a data matrix in "one-hot encoding" (all ones and zeros) with 260,000 rows and 35 columns. I am using Keras to train a simple neural network to predict a continuous variable. The code to make the network is the following: model = Sequential() model.add(Dense(1024, input_shape=(n_train,))) model.add(Activation('relu')) model.add(Dropout(0.1)) model.add(Dense(512)) model.add(Activation('relu')) model.add(Dropout(0.1)) model.add(Dense(256)) model.add(Activation('relu')) model.add(Dropout

build a .exe for Windows from a python 3 script importing theano with pyinstaller

拟墨画扇 提交于 2019-11-26 14:57:53
问题 edit September, 2, 2017, 1pm I eventually managed to build a .exe with pyinstaller after many episodes. Unfortunately I failed to deal with the ‘theano’ module (that is required in my case by the ‘pymc3’ module) and I had to modify the .py files and give up part of the application. My description below has two aims: first it may help; second could anyone help me building a .exe for windows 7+, with the ‘theano’ module ? reminder: My python 3 script opens a simple GUI made with Qt Designer in

How to compute Receiving Operating Characteristic (ROC) and AUC in keras?

别等时光非礼了梦想. 提交于 2019-11-26 12:21:03
问题 I have a multi output(200) binary classification model which I wrote in keras. In this model I want to add additional metrics such as ROC and AUC but to my knowledge keras dosen\'t have in-built ROC and AUC metric functions. I tried to import ROC, AUC functions from scikit-learn from sklearn.metrics import roc_curve, auc from keras.models import Sequential from keras.layers import Dense . . . model.add(Dense(200, activation=\'relu\')) model.add(Dense(300, activation=\'relu\')) model.add(Dense

总结和翻译机器学习和计算机视觉类资料的博客 ( 在微博上看到的)

雨燕双飞 提交于 2019-11-26 12:06:58
[置顶]说明 2015年05月25日 之前在csdn写博客,可是csdn经常进不去,所以转战博客园,,就用了一键博客搬家功能,只搬过来66篇,其中 Python2.3-原理之语句和语法 和 Python2.5-原理之模块 是手动搬过来的。估计版面格式也不太好看,欢迎收看csdn的博客:http://blog.csdn.net/shouhuxianjian 按照时间排序,在2015年5月25号之前的博客都来自csdn。 :) 2015年06月23日 今天早上发现发布在csdn上的博文居然莫名其妙的没了,昨天点击了发布,也看到了审核通过,结果今早发现完全没了,也就是找不回了。在2015年6月23日之前的博文都是csdn上搬到博客园的,所以格式会有问题,可以看csdn上的对应的文章。至于: 1、格式问题,好懒,等有空再弄吧 2、翻译问题,等自己第二次看到博文的时候在接着改,这些都是第一次翻译过来的,所以语句不是很通顺,也就是“信、达、雅”,自认为没完全做到,等第二次修改吧。 2015年8月31日 因为csdn博客发布系统有所改善,而且已经习惯了csdn的后台,所以其实博客园是备份,而csdn才是一直在的地方. 感谢您的关注并提出建议和意见! 多人交流才能够促进知识的成长,人类发展正是基于群体性智慧而不是靠个人的闭门造车就能够搞定的. 博文导航: Hinton的CSC321课程(完结