Git Product home page Git Product logo

aiplatform-intro's Introduction

Introduction to Google AI Platform

This file contains text you can copy and paste for the examples in Cloud Academy's Introduction to Google AI Platform course.

Introduction

Google Cloud Platform Free Trial

TensorFlow

TensorFlow website
TensorFlow installation

python3 -V      # Check which version of Python 3 is installed
pip3 install --user --upgrade pip
pip3 install --user --upgrade virtualenv
virtualenv mlenv
source mlenv/bin/activate
pip3 install tensorflow==2.2
git clone https://github.com/cloudacademy/aiplatform-intro.git
cd aiplatform-intro/iris/trainer
python3 iris.py --job-dir export

Training a Model with AI Platform

Google Cloud SDK installation

cd ..
gcloud ai-platform local train --module-name trainer.iris --package-path trainer --job-dir export
PROJECT=$(gcloud config list project --format "value(core.project)")
BUCKET=gs://${PROJECT}-aiplatform
REGION=us-central1
gsutil mb -l $REGION $BUCKET

AI Platform Training Regions

JOB=iris1
gcloud ai-platform jobs submit training $JOB \
    --module-name trainer.iris \
    --package-path trainer \
    --staging-bucket $BUCKET \
    --region $REGION \
    --python-version 3.7 \
    --runtime-version 2.2 \
    --job-dir $BUCKET/$JOB

Runtime version list

Feature Engineering

PetFinder dataset columns

pip3 install numpy pandas sklearn
cd ../pets
gcloud ai-platform local train --module-name trainer.pets --package-path trainer --job-dir export

Distributed Training on AI Platform

JOB=pets1
gcloud ai-platform jobs submit training $JOB \
    --module-name trainer.pets \
    --package-path trainer \
    --staging-bucket $BUCKET \
    --region $REGION \
    --python-version 3.7 \
    --runtime-version 2.2 \
    --scale-tier STANDARD_1 \
    --job-dir $BUCKET/$JOB

Deploying a Model on AI Platform

cd ../iris
gcloud ai-platform models create iris --regions=$REGION
gcloud ai-platform versions create v1 \
    --model iris \
    --runtime-version 2.2 \
    --region global \
    --origin $BUCKET/iris1
gcloud ai-platform predict \
    --model iris \
    --version v1 \
    --region global \
    --json-request test.json

Summary

AI Platform documentation
[email protected]

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.