[Python] Error while reading shap file from GCS bucket using vertex pipeline

Discussão em 'Python' iniciado por Stack, Fevereiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    I tried running this code:

    import shap
    from gcp_shared_utils.connectors.bucket import get_bucket_uri

    def read_explainerfile(self, bucket_name):
    try:
    bucket = self.client.bucket(bucket_name)
    logger.info("the bucket location for explainer file",bucket_name)
    blob = bucket.blob("mytest_folder/shap_explainer_v2_1.pkl")
    blob_data = blob.download_as_string()
    explainer = pickle.loads(blob_data)
    logger.info("Explainer file has been retrieved successfully", explainer)
    return explainer
    except Exception as e:
    logger.error(f"Failed to retrieve explainer file: {e}")
    raise


    But it raises the following exception: Error : [KFP Executor 2025-02-19 21:57:38,350 ERROR]: Failed to retrieve explainer file: Dispatcher._rebuild() got an unexpected keyword argument 'impl_kind'

    I have installed shap==0.44.0 and created a wheel file which is installed before the vertex pipeline execution starts.

    I also created a Python file to read the shap explainer file from my Workbench and the file was successfully read, but the code failed when running through the vertex pipeline.

    Continue reading...

Compartilhe esta Página