This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
explainable_ai_sdk.load_model_from_ai_platform errors with "google.auth.credentials' has no attribute 'CredentialsWithQuotaProject" #1
Comments
Hello! Sorry for the late reply. Could you check what version you have for the |
Hi:
google-auth 1.24.0
thanks,
jim
…________________________________
From: Nan-Chen Chen <[email protected]>
Sent: Thursday, February 18, 2021 6:35 PM
To: GoogleCloudPlatform/explainable_ai_sdk <[email protected]>
Cc: jimwill3 <[email protected]>; Author <[email protected]>
Subject: Re: [GoogleCloudPlatform/explainable_ai_sdk] explainable_ai_sdk.load_model_from_ai_platform errors with "google.auth.credentials' has no attribute 'CredentialsWithQuotaProject" (#1)
Hello! Sorry for the late reply. Could you check what version you have for the google-auth package?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEFVVF7FFY53UE7K57GT2EDS7WP4RANCNFSM4WORL5DA>.
|
upgraded to current google-auth. error now is the model cannot be found. my model is deployed to a region but the sdk seems to search globally only. there does not appear to be a parameter for region to pass to the api, although I see an SDK update was released yesterday, so I will upgrade and retry. thx. |
Cool. Please let us know if you still encounter issues :).
jimwill3 <[email protected]>於 2021年2月20日 週六,02:40寫道:
… upgraded to current google-auth. error now is the model cannot be found.
my model is deployed to a region but the sdk seems to search globally only.
there does not appear to be a parameter for region to pass to the api,
although I see an SDK update was released yesterday, so I will upgrade and
retry. thx.
jim
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZKR2F44EQXP2ITS64OD7TS72WALANCNFSM4WORL5DA>
.
|
upgrading to sdk 1.2 now shows region as a parameter and code is now working fine. |
Awesome. Glad to hear it is working :)
jimwill3 <[email protected]>於 2021年2月21日 週日,21:37寫道:
… upgrading to sdk 1.2 now shows region as a parameter and code is now
working fine.
thanks,
jim
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZKR2GZGJ5SPEEADJQECKTTAED73ANCNFSM4WORL5DA>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Following the notebook (just using different data) at GoogleCloudPlatform/ai-platform-samples/blob/master/notebooks/samples/explanations/tf2/ai-explanations-tabular.ipynb
using TF2.2 and 1.0.5 release of explainable_ai_sdk python 3.7. AI Platform Notebook instance.
When calling load_model_from_ai_platform(proj,model,version) the error is raised.
AttributeError: module 'google.auth.credentials' has no attribute 'CredentialsWithQuotaProject'
Not sure if this is due to a mistake I have made or a package dependency.
thanks,
jim
Here is the full error message:
AttributeError Traceback (most recent call last)
in
2 PROJECT_ID = 'jwtfxpipe'
3 print('model {} version {}'.format(MODEL,VERSION))
----> 4 remote_ig_model = explainable_ai_sdk.load_model_from_ai_platform(PROJECT_ID, MODEL, VERSION)
5 ig_response = remote_ig_model.explain([prediction_json])
6 print('OK@',time.asctime())
/opt/conda/lib/python3.7/site-packages/explainable_ai_sdk/model/model_factory.py in load_model_from_ai_platform(project, model, version, credentials)
56 if version:
57 endpoint = os.path.join(endpoint, 'versions', version)
---> 58 return _MODEL_REGISTRY[_REMOTE_MODEL_KEY](endpoint, credentials)
59
60
/opt/conda/lib/python3.7/site-packages/explainable_ai_sdk/model/ai_platform_model.py in init(self, endpoint, credentials)
48 self._credentials = credentials
49 self._endpoint = endpoint
---> 50 self._explanation_metadata = self._get_explanation_metadata()
51 self._modality_input_list_map = utils.get_modality_input_list_map(
52 self._explanation_metadata)
/opt/conda/lib/python3.7/site-packages/explainable_ai_sdk/model/ai_platform_model.py in _get_explanation_metadata(self)
103
104 """
--> 105 explanation_md_uri = self._get_explanation_metadata_uri()
106
107 md = explain_metadata.ExplainMetadata.from_file(explanation_md_uri)
/opt/conda/lib/python3.7/site-packages/explainable_ai_sdk/model/ai_platform_model.py in _get_explanation_metadata_uri(self)
83 gcs bucket uri.
84 """
---> 85 gcs_uri = self._get_deployment_uri()
86 match = re.search('gs://(?P<bucket_name>[^/])[/](?P.*)',
87 gcs_uri)
/opt/conda/lib/python3.7/site-packages/explainable_ai_sdk/model/ai_platform_model.py in _get_deployment_uri(self)
63 """
64 response = http_utils.make_get_request_to_ai_platform(
---> 65 self._endpoint, self._credentials)
66
67 if 'deploymentUri' not in response:
/opt/conda/lib/python3.7/site-packages/explainable_ai_sdk/model/http_utils.py in make_get_request_to_ai_platform(uri_params_str, credentials, timeout_ms)
93 Request results in json format.
94 """
---> 95 headers = _get_request_header(credentials)
96 ai_platform_endpoint = (
97 os.getenv('CLOUDSDK_API_ENDPOINT_OVERRIDES_ML') or
/opt/conda/lib/python3.7/site-packages/explainable_ai_sdk/model/http_utils.py in _get_request_header(credentials)
40 # If credentials is not given, use the default credentials
41 if credentials is None:
---> 42 credentials, _ = google.auth.default()
43
44 # Refresh credentials in case it has been expired.
/opt/conda/lib/python3.7/site-packages/google/auth/_default.py in default(scopes, request)
306 scopes (Sequence[str]): The list of scopes for the credentials. If
307 specified, the credentials will automatically be scoped if
--> 308 necessary.
309 request (google.auth.transport.Request): An object used to make
310 HTTP requests. This is used to detect whether the application
/opt/conda/lib/python3.7/site-packages/google/auth/_default.py in _get_gae_credentials()
178 explicit_file = os.environ.get(environment_vars.CREDENTIALS)
179
--> 180 _LOGGER.debug(
181 "Checking %s for explicit credentials as part of auth process...", explicit_file
182 )
/opt/conda/lib/python3.7/site-packages/google/auth/app_engine.py in
79
80 class Credentials(
---> 81 credentials.Scoped, credentials.Signing, credentials.CredentialsWithQuotaProject
82 ):
83 """App Engine standard environment credentials.
AttributeError: module 'google.auth.credentials' has no attribute 'CredentialsWithQuotaProject'
The text was updated successfully, but these errors were encountered: