GoogleCloudPlatform / mlops-with-vertex-ai

An end-to-end example of MLOps on Google Cloud using TensorFlow, TFX, and Vertex AI
Apache License 2.0
341 stars 117 forks source link

01-dataset-management.ipynb fails at "Create Vertex Dataset resource" with "no attribute 'SUPPORTED_REGIONS'" #32

Open destijl opened 10 months ago

destijl commented 10 months ago

In 01-dataset-management.ipynb at "Create Vertex Dataset resource" I get the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/var/tmp/ipykernel_23085/3064911949.py in <module>
      1 vertex_ai.init(
      2     project=PROJECT,
----> 3     location=REGION
      4 )

/opt/conda/lib/python3.7/site-packages/google/cloud/aiplatform/initializer.py in init(self, project, location, experiment, experiment_description, staging_bucket, credentials, encryption_spec_key_name)
     97             self._project = project
     98         if location:
---> 99             utils.validate_region(location)
    100             self._location = location
    101         if staging_bucket:

/opt/conda/lib/python3.7/site-packages/google/cloud/aiplatform/utils/__init__.py in validate_region(region)
    272 
    273     region = region.lower()
--> 274     if region not in constants.SUPPORTED_REGIONS:
    275         raise ValueError(
    276             f"Unsupported region for Vertex AI, select from {constants.SUPPORTED_REGIONS}"

AttributeError: module 'google.cloud.aiplatform.constants' has no attribute 'SUPPORTED_REGIONS'

It's mentioned here: https://github.com/googleapis/python-aiplatform/issues/1106

Sounds like it used to be in constants.SUPPORTED_REGIONS and now it's in constants.base.SUPPORTED_REGION.