我想跑
this
python笔记本,其中使用Keras实现了著名的卷积神经网络。作者使用theano作为后端,并使用他的cpu设备。因为CUDA不支持我的CPU(需要使用它),所以我将尝试使用我的gpu(首先)。
我安装了keras和theano以及以下所需要求
this
链接我跳过了gpu配置,因为我想使用我的gpu。
要使用我的GPU,我更改了第一行中的设备标志,结果如下:
#%matplotlib inline
import numpy as np
import pandas as pd
import sys
from skimage.io import imread
from matplotlib import pyplot as plt
import os
os.environ['KERAS_BACKEND'] = 'theano'
os.environ['THEANO_FLAGS'] = 'mode=FAST_RUN, device=cpu, floatX=float32, optimizer=fast_compile'
from keras import models
from keras.optimizers import SGD
这给了我一个错误:
AttributeError: ('This name is already taken', 'floatX')