サンプルコードの実行 をすると
以下のようなエラーが出ます。
何が原因でしょうか?
Output exceeds the size limit. Open the full output data in a text editor
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/tmp/ipykernel_2298/1613884832.py in <module>
1 from tensorflow import keras
2 from tensorflow.keras.utils import plot_model
----> 3 model = keras.models.load_model('forecast-tokyo.h5')
4 plot_model(model, show_layer_names=False, show_shapes=True)
~/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/save.py in load_model(filepath, custom_objects, compile)
144 if (h5py is not None and (
145 isinstance(filepath, h5py.File) or h5py.is_hdf5(filepath))):
--> 146 return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
147
148 if isinstance(filepath, six.string_types):
~/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py in load_model_from_hdf5(filepath, custom_objects, compile)
166 model_config = json.loads(model_config.decode('utf-8'))
167 model = model_config_lib.model_from_config(model_config,
--> 168 custom_objects=custom_objects)
169
170 # set weights
~/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/model_config.py in model_from_config(config, custom_objects)
53 '`Sequential.from_config(config)`?')
54 from tensorflow.python.keras.layers import deserialize # pylint: disable=g-import-not-at-top
...
--> 736 " array.".format(self.name))
737
738 def __len__(self):
NotImplementedError: Cannot convert a symbolic Tensor (lstm_2/strided_slice:0) to a numpy array.