亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

由于 CUDA 錯誤,無法從 Keras 模型進行預測

由于 CUDA 錯誤,無法從 Keras 模型進行預測

慕妹3146593 2023-10-18 22:06:29
我是Python新手。我按照這個網站作為指導來進行一些未來的預測。完成所有操作后,圖表沒有顯示,并且出現以下錯誤:2020-10-09 08:27:09.619051: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found2020-10-09 08:27:09.620905: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.這是我寫的代碼:import pandas as pdimport numpy as npimport tensorflow as tfimport kerasfrom keras.preprocessing.sequence import TimeseriesGeneratorfrom keras.models import Sequentialfrom keras.layers import LSTM, Denseimport plotly.graph_objects as godf = pd.read_excel('T:/Python/NRN-Netze_Python/Stromverbrauch2Jahren.xlsx')print(df.info())df['Datum'] = pd.to_datetime(df['Datum'])df.set_axis(df['Datum'], inplace = True)df.drop(columns = ['Datum_u_Uhrzeit', 'Stunden', 'Minuten', 'Uhrzeit'], inplace = True)value = df['Werte'].valuesvalue = value.reshape((-1, 1))split_percent = 0.80split = int(split_percent * len(value))value_train = value[:split]value_test = value[split:]date_train = df['Datum'][:split]date_test = df['Datum'][split:]print('')print(len(value_train))print(len(value_test))look_back = 15train_generator = TimeseriesGenerator(value_train, value_train, length = look_back, batch_size = 20)test_generator = TimeseriesGenerator(value_test, value_test, length = look_back, batch_size = 1)model = Sequential()model.add(LSTM(10, activation = 'relu', input_shape = (look_back, 1)))model.add(Dense(1))model.compile(optimizer = 'adam', loss = 'mse')num_epochs = 25model.fit(train_generator, epochs = num_epochs, verbose = 1)prediction = model.predict(test_generator)value_train = value_train.reshape((-1))value_test = value_test.reshape((-1))prediction = prediction.reshape((-1))trace1 = go.Scatter(    x = date_train,    y = value_train,    mode = 'lines',    name = 'Original')
查看完整描述

1 回答

?
素胚勾勒不出你

TA貢獻1827條經驗 獲得超9個贊

從錯誤信息來看,你的顯卡好像沒有安裝CUDA驅動。



查看完整回答
反對 回復 2023-10-18
  • 1 回答
  • 0 關注
  • 113 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號