mirror of
https://github.com/GoogleCloudPlatform/vertex-ai-samples.git
synced 2026-09-26 14:42:04 +00:00
* Removed extra scaling call in image notebooks * formatting/linting updates
This commit is contained in:
@@ -480,8 +480,7 @@
|
||||
"\n",
|
||||
"from google.cloud.aiplatform import gapic as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+1
-2
@@ -505,8 +505,7 @@
|
||||
"\n",
|
||||
"import google.cloud.aiplatform_v1beta1 as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -482,8 +482,7 @@
|
||||
"\n",
|
||||
"from google.cloud.aiplatform import gapic as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+5
-7
@@ -483,8 +483,7 @@
|
||||
"\n",
|
||||
"from google.cloud.aiplatform import gapic as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1710,7 +1709,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import tensorflow as tf\n",
|
||||
"from tensorflow.keras import Input, Model\n",
|
||||
"from tensorflow.keras import Model\n",
|
||||
"from tensorflow.keras.layers import Lambda\n",
|
||||
"\n",
|
||||
"softmax = model_A.outputs[0]\n",
|
||||
@@ -1822,16 +1821,15 @@
|
||||
"CONCRETE_INPUT = \"numpy_inputs\"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def _preprocess(bytes_input):\n",
|
||||
"def _preprocess(bytes_input): # noqa: 811\n",
|
||||
" decoded = tf.io.decode_jpeg(bytes_input, channels=3)\n",
|
||||
" decoded = tf.image.convert_image_dtype(decoded, tf.float32)\n",
|
||||
" resized = tf.image.resize(decoded, size=(32, 32))\n",
|
||||
" rescale = tf.cast(resized / 255.0, tf.float32)\n",
|
||||
" return rescale\n",
|
||||
" return resized\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"@tf.function(input_signature=[tf.TensorSpec([None], tf.string)])\n",
|
||||
"def preprocess_fn(bytes_inputs):\n",
|
||||
"def preprocess_fn(bytes_inputs): # noqa: 811\n",
|
||||
" decoded_images = tf.map_fn(\n",
|
||||
" _preprocess, bytes_inputs, dtype=tf.float32, back_prop=False\n",
|
||||
" )\n",
|
||||
|
||||
+1
-2
@@ -482,8 +482,7 @@
|
||||
"\n",
|
||||
"from google.cloud.aiplatform import gapic as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+1
-2
@@ -507,8 +507,7 @@
|
||||
"\n",
|
||||
"import google.cloud.aiplatform_v1beta1 as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+1
-2
@@ -484,8 +484,7 @@
|
||||
"\n",
|
||||
"from google.cloud.aiplatform import gapic as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+1
-5
@@ -483,8 +483,7 @@
|
||||
"\n",
|
||||
"from google.cloud.aiplatform import gapic as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1247,9 +1246,6 @@
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.struct_pb2 import Value\n",
|
||||
"\n",
|
||||
"MODEL_NAME = \"custom_pipeline-\" + TIMESTAMP\n",
|
||||
"PIPELINE_DISPLAY_NAME = \"custom-training-pipeline\" + TIMESTAMP\n",
|
||||
"\n",
|
||||
|
||||
+1
-2
@@ -482,8 +482,7 @@
|
||||
"\n",
|
||||
"from google.cloud.aiplatform import gapic as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+1
-2
@@ -483,8 +483,7 @@
|
||||
"\n",
|
||||
"from google.cloud.aiplatform import gapic as aip\n",
|
||||
"from google.protobuf import json_format\n",
|
||||
"from google.protobuf.json_format import MessageToJson, ParseDict\n",
|
||||
"from google.protobuf.struct_pb2 import Struct, Value"
|
||||
"from google.protobuf.struct_pb2 import Value"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user