2024-09-29 21:48:07 发布
网友
当使用tensorflow版本2.3.0时,输出模型不清晰,如何解决
tensorflow
2.3.0
import tensorflow as tf base_model = tf.keras.applications.EfficientNetB7(weights='imagenet', include_top=False) # or weig tf.keras.utils.plot_model(base_model, to_file="image1.png", dpi=120)
它看起来如下所示
所以问题是,您试图输出为图像的模型是一个巨大的模型。因此dpi=120在PNG格式中几乎不够。为了获得更清晰的图像,请将其保存为PDF格式。然后,如果您愿意,您可以轻松地转换为图像
dpi=120
使用以下方法:
import tensorflow as tf base_model = tf.keras.applications.EfficientNetB7(weights='imagenet', include_top=False) # or weig tf.keras.utils.plot_model(base_model, to_file="image1.pdf", dpi=120)
给了我以下信息(当我刚将屏幕打印到特定块上时):
所以问题是,您试图输出为图像的模型是一个巨大的模型。因此
dpi=120
在PNG格式中几乎不够。为了获得更清晰的图像,请将其保存为PDF格式。然后,如果您愿意,您可以轻松地转换为图像使用以下方法:
给了我以下信息(当我刚将屏幕打印到特定块上时):
相关问题 更多 >
编程相关推荐