2017-02-20 20 views
0

autoencoder_layers.py github code私は、GPU上autoencoder_layers.py使用kerasを実行しようとしていますが、私はこのエラーに

import theano 
from keras import backend as K 
from keras.backend.theano_backend import _on_gpu 
from keras.layers.convolutional import Convolution2D, UpSampling2D 
from keras.layers.core import Dense, Layer 
from theano import tensor as T 
from theano.sandbox.cuda import dnn 

を取得するが、私はこのエラーを取得:

/home/hoda/anaconda2/bin/python /home/hoda/Downloads/keras-convautoencoder-master/autoencoder_layers.py 
Using gpu device 0: GeForce GTX 970M (CNMeM is disabled, cuDNN not available) 
Using Theano backend. 
Traceback (most recent call last): 
    File "/home/hoda/Downloads/keras-convautoencoder-master/autoencoder_layers.py", line 3, in <module> 
    from keras.backend.theano_backend import _on_gpu 
ImportError: cannot import name _on_gpu 

は、私はそれを修正することができますか?

答えて

0

コメントラインfrom keras.backend.theano_backend import _on_gpu_on_gpuとして定義します。それはあなたのエラーを修正します

def _on_gpu(): 
    return theano.config.device[:3] == 'gpu' 

+0

ありがとうございます!それはそれを修正しました! –

+0

あなたは大歓迎です。答えを受け入れることができますか? – indraforyou

関連する問題