-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGoogle Fly Cup Challenge: Pilot
95 lines (50 loc) · 1.9 KB
/
Google Fly Cup Challenge: Pilot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Just change the NAME given in your lab
export BUCKET_NAME=
export BUCKET_LOCATION=
### Task 1
gsutil mb -l $BUCKET_LOCATION -b on gs://$BUCKET_NAME
### Task 2
bq mk drl
bq load --source_format=CSV drl.pilot-event-times spls/gsp396/lab2.csv --auto-detect
### Task 3
gsutil cp gs://spls/gsp396/DRL2.ipynb .
### Task 4
Run all of the cells in the DRL2.ipynb file.
When setting the PROJECT variable, replace its value with the unique project id of the qwiklabs project
### Task 5
## Navigate to Vertex AI > Model Registry
Click Import
Name the model drl-pilot-ranking
Choose the dynamically selected region variable displayed in Task 4 for the region
# Click Model Settings
Choose 2.8 for the Model Framework Version
# Navigate and select the following path for the Model Artifact Location:
PROJECT-ID/model
### Task 6
Navigate to Vertex AI > Endpoints
Click Create Endpoint
Name the endpoint drl-pr-endpoint
Choose the dynamically generated region for the region
Ensure the traffic split is set to 100%
Click on advanced scaling settings
Choose n1-standard-2 for machine type
Click Create
### Task 7
## Return to your notebook tab
# Create a new cell and add the following code:
from google.cloud import aiplatform
PROJECT = '[project-id]'
LOCATION = '[region]'
ENDPOINT_ID = '[your-endpoint-id]'
endpoint = aiplatform.Endpoint(ENDPOINT_ID, project=PROJECT, location=LOCATION)
instances = [{'pilot_id': [11],
'ename': ['Practice'],
'events_name':['Project Manhattan'],
'minimum_time': [80.0]
}]
endpoint.predict(instances = instances)
# Replace [project-id] with the unique qwiklabs project id.
# Replace [region] with the dynamically selected region variable used for the endpoint
# Replace [your-endpoint-id] with the endpoint's unique ID
# Both the region and endpoint ID can be found in the Endpoints page in the console
# Run the cell in your Vertex Notebook