当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, weights, classes_str): """ Takes a path to an image and returns the predicted class and confidence score. """ classes = classes_str.split(",") K.clear_session() # Make and parse the prediction model = load_model(layers, weights) output = model.predict(image) prediction_index = output[0].argmax() confidence = float(output[0][prediction_index]) # prediction = {'class': classes[prediction_index], 'confidence': confidence} prediction = classes[prediction_index] K.clear_session() return prediction, confidence 

我在Docker中的Django服务器中运行Tensorflow,当我尝试进行预测时,得到以下输出:

 python_1 | 2017-11-24 20:18:24.198764: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. python_1 | 2017-11-24 20:18:24.200163: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. python_1 | 2017-11-24 20:18:24.200171: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. python_1 | 2017-11-24 20:18:24.200174: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. python_1 | 2017-11-24 20:18:24.200177: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. project_python_1 exited with code 0