【发布时间】:2022-01-25 20:12:24
【问题描述】:
我正在尝试在 Keras 中制作深度学习模型的绘图/图表,但它一直给我一个信息量不大的错误。
这是我的代码:
import pandas as pd
forecast_demo = pd.read_csv('forcastdemo.csv')
forecast_demo.head()
X_train = forecast_demo[['index', 'quarter']]
y_train = forecast_demo.revenue
import keras
from tensorflow.keras import Model
from tensorflow.keras import models
from tensorflow.keras.utils import plot_model
from tensorflow.keras.layers import Input, Dense, BatchNormalization
from IPython.core.display import Image
inputs = Input(shape=(2,))
x = BatchNormalization()(inputs)
x = Dense(512, activation='relu')(x)
x = Dense(128, activation='relu')(x)
x = Dense(64, activation='relu')(x)
x = Dense(32, activation='relu')(x)
outputs = Dense(1)(x)
model = Model(inputs, outputs)
model.summary()
keras.utils.plot_model(model,to_file='images/oefening2.png', show_shapes=True)
Image('images/oefening2.png')'''
这是我的错误信息:
2021-12-26 11:10:25.714969: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-12-26 11:10:25.715102: 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.
2021-12-26 11:10:28.763546: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2021-12-26 11:10:28.763672: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
2021-12-26 11:10:28.766276: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: PROBOOK17
2021-12-26 11:10:28.766428: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: PROBOOK17
2021-12-26 11:10:28.766711: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "C:\Users\lotte.similon\Documents\datascience\lessen\overzicht_code\oefeningen_ANN.py", line 87, in <module>
keras.utils.plot_model(model,to_file='images/oefening2.png', show_shapes=True)
AttributeError: module 'keras.utils' has no attribute 'plot_model
【问题讨论】:
-
this answer 有帮助吗?
标签: python tensorflow machine-learning keras deep-learning