Keras模型无法编译:退出代码“-1073741819(0xC0000005)”

时间:2017-10-14 14:14:17

标签: python-3.x tensorflow pycharm keras

目标:使用具有张量流后端的keras训练神经网络。这是脚本:

import pandas as pd
from keras.models import Sequential
from keras.layers import *

training_data_df = pd.read_csv("sales_data_training_scaled.csv")

X = training_data_df.drop('total_earnings', axis=1).values
Y = training_data_df[['total_earnings']].values

# Define the model
model = Sequential()
model.add(Dense(50, input_dim=9, activation='relu'))
model.add(Dense(100, activation='relu'))
model.add(Dense(50, activation='relu'))
model.add(Dense(1, activation='linear'))
model.compile(loss='mean_squared_error', optimizer='adam')

# Train the model
model.fit(
    X,
    Y,
    epochs=50,
    shuffle=True,
    verbose=2)

# Load the separate test data set
test_data_df = pd.read_csv("sales_data_test_scaled.csv")

X_test = test_data_df.drop('total_earnings', axis=1).values
Y_test = test_data_df[['total_earnings']].values

test_error_rate = model.evaluate(X_test, Y_test, verbose=0)
print("The mean squared error (MSE) for the test data set is: {}".format(test_error_rate))

在pycharm(v2017.2.3)中运行上面的代码并使用python 3.5(因为tensorflow需要它)时,我发现以下错误:

“处理已完成,退出代码为-1073741819(0xC0000005)”

我已经广泛寻找解决方案,但无济于事。一篇文章建议培训数据可能包含非数字值 - 不是这种情况。此外,以下链接未能提供一致的解决方案: I am unable to run my python code and get "Process finished with exit code -1073741819 (0xC0000005)" C, Python, ctypes exit code -1073741819 (0xC0000005)

我被困了......

0 个答案:

没有答案