pycharm中出現的錯誤


錯誤1

在pycharm上安裝TensorFlow運行import tensorflow時報錯:

File "<frozen importlib._bootstrap>", line 967, in _find_and_load SystemError: PyEval_EvalFrameEx 。。。。。。。。。。。。。。。

。。。。。。。Check failed: PyBfloat16_Type.tp_base != nullptr

 

 

1)解決方法:

    升級numpy后成功

    

  pip install numpy --upgrade

 

 


from numpy import arrayfrom keras.models import Sequentialfrom keras.layers import LSTMfrom keras.layers import Dense# define datasetX = array([[10, 20, 30], [20, 30, 40], [30, 40, 50], [40, 50, 60]])y = array([40, 50, 60, 70])# reshape from [samples, timesteps] into [samples, timesteps, features]X = X.reshape((X.shape[0], X.shape[1], 1))# define modelmodel = Sequential()model.add(LSTM(50, activation='relu', input_shape=(3, 1)))model.add(Dense(1))model.compile(optimizer='adam', loss='mse')# fit modelmodel.fit(X, y, epochs=1000, verbose=0)# demonstrate predictionx_input = array([50, 60, 70])x_input = x_input.reshape((1, 3, 1))yhat = model.predict(x_input, verbose=0)print(yhat)--------------------- 作者:njzhuming 來源:CSDN 原文:https://blog.csdn.net/njzhuming/article/details/84901409 版權聲明:本文為博主原創文章,轉載請附上博文鏈接!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM