(self, name, path)
return self
Check if the model exists at the specified path and return it to the caller.
        If the model is not found throw an exception.
Check if the model exists at the specified path and return it to the caller.
        If the model is not found throw an exception.
Check if the model exists at the specified path and return it to the caller . If the model is not found throw an exception .
def load(self, name, path):
        """
        Check if the model exists at the specified path and return it to the caller.
        If the model is not found throw an exception.
        """
        
        with open(Path(path + name + '.joblib'), 'rb') as f:
            self = joblib.load(f)
        
        # If using Keras we need to load the HDF5 file as well
        # The model will only be available if the fit method has been called previously
        if self.using_keras and hasattr(self, 'pipe'):
            # Avoid tensorflow error for keras models
            # https://github.com/tensorflow/tensorflow/issues/14356
            # https://stackoverflow.com/questions/40785224/tensorflow-cannot-interpret-feed-dict-key-as-tensor
            kerasbackend.clear_session()
            
            # Load the keras model architecture and weights from disk
            keras_model = keras.models.load_model(path + name + '.h5')
            keras_model._make_predict_function()                
            # Point the estimator in the sklearn pipeline to the keras model architecture and weights 
            self.pipe.named_steps['estimator'].model = keras_model

        return self
def load ( self , name , path ) : with open ( Path ( path + name + '.joblib' ) , 'rb' ) as f : self = joblib . load ( f ) # If using Keras we need to load the HDF5 file as well # The model will only be available if the fit method has been called previously if self . using_keras and hasattr ( self , 'pipe' ) : # Avoid tensorflow error for keras models # https://github.com/tensorflow/tensorflow/issues/14356 # https://stackoverflow.com/questions/40785224/tensorflow-cannot-interpret-feed-dict-key-as-tensor kerasbackend . clear_session ( ) # Load the keras model architecture and weights from disk keras_model = keras . models . load_model ( path + name + '.h5' ) keras_model . _make_predict_function ( ) # Point the estimator in the sklearn pipeline to the keras model architecture and weights  self . pipe . named_steps [ 'estimator' ] . model = keras_model return self