Tag: keras

当Keras(Tensorflow)在Django启动时Docker退出

我目前在同一个docker集装箱的本地工作,但在我的数字海洋液滴,我无法得到它的工作。 我相信错误发生在这里: https : //github.com/jrobchin/lyterai/blob/master/app/hub/demo/keras_demo.py from keras import backend as K from keras.preprocessing import image from keras.applications.imagenet_utils import preprocess_input from keras.models import model_from_json K.set_image_dim_ordering('tf') K.set_image_data_format('channels_last') def load_model(layers, weights): # Load model architecture and parameters model_json = open(layers, 'r') loaded_model_json = model_json.read() model_json.close() model = model_from_json(loaded_model_json) # Load model weights model.load_weights(weights) return model def predict(image, layers, […]

在Mac上的Docker中运行Keras时的内存问题

运行Keras训练algorithm会在Mac上的Docker机器中运行时产生各种内存问题。 训练algorithm在Docker之外的同一台机器上工作正常 将Docker内存从1 GB设置为8 GB(机器的限制)不起作用 最大video内存:128 MB 不同的TensorFlow( 0.10.0和0.11.0 )和从Docker中提取的Theano后端都显示类似的错误 其他Docker进程可能与docker ps -a冲突的列表是空的 问题是我得到的性能低得多 ,在Docker的同一台机器上运行相同的训练algorithm 。 所有的错误都指向内存pipe理问题 : 1)最初的错误是MemoryError ,当在容器的docker build过程中运行训练脚本时,它甚至在训练开始之前退出了这个过程。 2)现在我得到ResourceExhaustedError:运行docker run 058785edc11d python train.py –run后分配与形状张量[64,64,254,254] OOM docker run 058785edc11d python train.py –run一旦容器被build立(运行似乎更进一步): Training.. Train on 385 samples, validate on 40 samples Epoch 1/1 sample_weight=sample_weight) File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1046, in fit callback_metrics=callback_metrics) File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", […]

带有TensorFlow后端的Keras不使用GPU

我用keras 2.0.0版和tensorflow 0.12.1版构build了Docker镜像的gpu版本https://github.com/floydhub/dl-docker 。 然后我运行了mnist教程https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py,但意识到keras没有使用GPU。 以下是我的输出 root@b79b8a57fb1f:~/sharedfolder# python test.py Using TensorFlow backend. Downloading data from https://s3.amazonaws.com/img-datasets/mnist.npz x_train shape: (60000, 28, 28, 1) 60000 train samples 10000 test samples Train on 60000 samples, validate on 10000 samples Epoch 1/12 2017-09-06 16:26:54.866833: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available […]