Group Group Group Group Group Group Group Group Group

Python issue_______

"Saving and Loading a Model
In [76]:

from tensorflow.keras.models import load_model
In [77]:‘my_model.h5’) # creates a HDF5 file ‘my_model.h5’
In [78]:

later_model = load_model(‘my_model.h5’)

AttributeError Traceback (most recent call last)
----> 1 later_model = load_model(‘my_model.h5’)

~/PycharmProjects/NNTrading/venv/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/ 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)
148 if isinstance(filepath, six.string_types):

~/PycharmProjects/NNTrading/venv/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/ in load_model_from_hdf5(filepath, custom_objects, compile)
164 if model_config is None:
165 raise ValueError(‘No model found in config file.’)
–> 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)

AttributeError: ‘str’ object has no attribute ‘decode’

In [79]:


NameError Traceback (most recent call last)
----> 1 later_model.predict(new_gem)

NameError: name ‘later_model’ is not defined
how do I fix this? im running python 3.7