Giter VIP home page Giter VIP logo

Comments (8)

statmike avatar statmike commented on May 31, 2024 1

Hello @khadijakhaldi and @JonB451
I just noticed this issue as closed. I took a look and the SDK for kfp and google_cloud_pipeline_components have shift a little since this notebook was create. I just pushed an update version of the notebook that should resolve this problem. I tested it through running the pipeline and it worked.
Thank You!
@statmike

from vertex-ai-mlops.

JonB451 avatar JonB451 commented on May 31, 2024

A workaround may be:

from google.cloud import aiplatform as gcc_aip

though this leads, later in the notebook, to:

AttributeError: module 'google.cloud.aiplatform' has no attribute 'TabularDatasetCreateOp'

from vertex-ai-mlops.

khadijakhaldi avatar khadijakhaldi commented on May 31, 2024

@JonB451 did you solve this ?

from vertex-ai-mlops.

JonB451 avatar JonB451 commented on May 31, 2024

Thanks @statmike . I've had to move onto something else for now, but will let you know when i get back to this. It's still high enough up my priorities that i hope that should be possible in the coming weeks so i will feedback if it worked here too. Thanks again, loads. You are a brilliant teacher, and generours, in material and in spirit it seems!

from vertex-ai-mlops.

JonB451 avatar JonB451 commented on May 31, 2024

@khadijakhaldi No, i didn't.

from vertex-ai-mlops.

JonB451 avatar JonB451 commented on May 31, 2024

@statmike Unfortunately, after pulling these changes, the imports do not work in my env.

Despite replicating your procedures as closely as possible there was at least one difference, in the creation of the notebook instance and its env version, if i remember correctly. I don't think the 'TensorFlow Enterprise 2.3' env was available (Support End Date: 16.08.23) so i used 'TensorFlow Enterprise 2.6' which is python3.9 (rather 3.7), as you can see below in excerpts from the error.


ImportError Traceback (most recent call last)

Cell In[4], line 8
----> 8 from google_cloud_pipeline_components.v1.automl.training_job import AutoMLTabularTrainingJobRunOp

File /opt/conda/lib/python3.9/site-packages/google_cloud_pipeline_components/v1/automl/training_job/init.py:16
---> 16 from google_cloud_pipeline_components.v1.automl.training_job.automl_forecasting_training_job.component import automl_forecasting_training_job as AutoMLForecastingTrainingJobRunOp

File /opt/conda/lib/python3.9/site-packages/google_cloud_pipeline_components/v1/automl/training_job/automl_forecasting_training_job/component.py:22
---> 22 from kfp.dsl import Input

ImportError: cannot import name 'Input' from 'kfp.dsl' (/opt/conda/lib/python3.9/site-packages/kfp/dsl/init.py)

from vertex-ai-mlops.

statmike avatar statmike commented on May 31, 2024

Hello @JonB451 ,

Any notebook environment should work for this. The main thing is the package installs with:

!pip install kfp google-cloud-pipeline-components google-cloud-aiplatform -q -U

To test this out I started a new environment, did these pip installs and tried importing and checking versions:

from google.cloud import aiplatform

import kfp
from kfp.v2 import compiler
#import kfp.v2.dsl as dsl
import google_cloud_pipeline_components as gcc_aip
from google_cloud_pipeline_components.v1.dataset import TabularDatasetCreateOp
from google_cloud_pipeline_components.v1.automl.training_job import AutoMLTabularTrainingJobRunOp
from google_cloud_pipeline_components.v1.endpoint import EndpointCreateOp, ModelDeployOp
  • !python --version = 3.10.12
  • aiplatform.__version__ = 1.31.1
  • kfp.__version__ = 2.0.1
  • gcc_aip.__version__ = 2.3.0

Maybe try fresh pip installs with the -U option?

from vertex-ai-mlops.

JonB451 avatar JonB451 commented on May 31, 2024

Hello @statmike.

Sorry i didn't respond sooner but i haven't been able to continue with this course before my GCP trial runs out.

Although i cannot remember clearly now, i wanted to thank you for your reply and to respond. My memory is that you were right, and this was resolved as you suggested with fresh installs.

All the best. Sad not to be continuing your great course!

from vertex-ai-mlops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.