gpt4 book ai didi

python - 无法从 keras.utils 导入 plot_model?

转载 作者:行者123 更新时间:2023-12-04 12:19:16 25 4
gpt4 key购买 nike

当我在我的代码中运行这一行时,from keras.utils import plot_model我得到以下信息:

"ImportError: cannot import name 'plot_model' from 'keras.utils' (/usr/local/lib/python3.7/dist-packages/keras/utils/__init__.py)"
当我昨晚上床 sleep 时,它正在工作。今天早上它抛出一个错误。发生了什么,我该怎么办?谢谢你。
任何建议将不胜感激

最佳答案

这工作取自 TensorFlow documentation

from keras.utils.vis_utils import plot_model
tf.keras.utils.plot_model(
model, to_file='model.png', show_shapes=False, show_dtype=False,
show_layer_names=True, rankdir='TB', expand_nested=False, dpi=96
)

关于python - 无法从 keras.utils 导入 plot_model?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67703817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com