为了账号安全,请及时绑定邮箱和手机立即绑定

由于 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 关注
  • 79 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信