该代码给出以下错误消息
Cannot import name 'wrappers' from 'tensorflow.python.keras.layers'- 和ImportError: graphviz or pydot are not available.即使安装graphviz并pydot使用后!apt-get -qq install -y graphviz && pip install pydot仍然无法生成model.png.
我在 colab 中运行以下代码
try:
# %tensorflow_version only exists in Colab.
%tensorflow_version 2.x
except Exception:
pass
import tensorflow as tf
from tensorflow.python.keras.utils.vis_utils import plot_model
import pydot
from tensorflow.keras.models import Model
def build_model_with_sequential():
# instantiate a Sequential class and linearly stack the layers of your model
seq_model = tf.keras.models.Sequential([tf.keras.layers.Flatten(input_shape=(28, …Run Code Online (Sandbox Code Playgroud)