I have trained a machine learning model and saved it as an hdf5 file
model.save('landcover_100_epochs_RESNET_backbone_batch16.hdf5')
Now when I try to load the model in jupyter notebook, it works without errors
from keras.models import load_model
model = load_model("landcover_100_epochs_RESNET_backbone_batch16.hdf5", compile=False)
But when I write the same code in QGIS plugin's python file it gives the following error:
2022-11-10T18:47:20 WARNING Traceback (most recent call last):
File "C:/Users/hp/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\shpfilegenerator\ShpFileGenerator.py", line 204, in createSHP
model = load_model(self.modelPath,compile=False)
File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\tensorflow\python\keras\saving\save.py", line 146, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 168, in load_model_from_hdf5
raise ImportError('`load_model` requires h5py.')
ImportError: `load_model` requires h5py.
Here modelPath stores the location where the model is saved. Can anyone please help me with this error?