import os
from urllib.request import urlretrieve
from zipfile import ZipFile
example_dir = '/work/examples'
zip_file = 'pet-classification.zip'
model_file = 'pet-classification.h5'
info_file = 'pet-classification.json'
img_file = 'dog.png'
os.makedirs(example_dir, exist_ok=True)
zip_path = os.path.join(example_dir, zip_file)
model_path = os.path.join(example_dir, model_file)
info_path = os.path.join(example_dir, info_file)
img_path = os.path.join(example_dir, img_file)
zip_url = f'https://spbai-superb-biz-test.s3.ap-northeast-2.amazonaws.com/cal-examples/{zip_file}'
urlretrieve(zip_url, zip_path)
with ZipFile(zip_path) as f:
f.extract(model_file, path=example_dir)
f.extract(info_file, path=example_dir)
f.extract(img_file, path=example_dir)
import tensorflow as tf
from PIL import Image
%matplotlib inline
import matplotlib.pyplot as plt
try:
for device in tf.config.list_physical_devices('GPU'):
tf.config.experimental.set_memory_growth(device, True)
except:
pass
model = tf.keras.models.load_model(model_path)
2022-04-17 18:39:23.264972: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-04-17 18:39:27.376846: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 12546 MB memory: -> device: 0, name: TITAN RTX, pci bus id: 0000:3b:00.0, compute capability: 7.5 2022-04-17 18:39:27.379054: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:1 with 3960 MB memory: -> device: 1, name: TITAN RTX, pci bus id: 0000:5e:00.0, compute capability: 7.5 2022-04-17 18:39:27.381163: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:2 with 3962 MB memory: -> device: 2, name: TITAN RTX, pci bus id: 0000:86:00.0, compute capability: 7.5 2022-04-17 18:39:27.383194: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:3 with 3959 MB memory: -> device: 3, name: TITAN RTX, pci bus id: 0000:af:00.0, compute capability: 7.5 /usr/local/lib/python3.7/dist-packages/keras/layers/core/lambda_layer.py:299: UserWarning: cal_download.onnx2keras.operation_layers is not loaded, but a Lambda layer uses it. It may cause errors. 'function_type') /usr/local/lib/python3.7/dist-packages/keras/layers/core/lambda_layer.py:299: UserWarning: cal_download.onnx2keras.utils is not loaded, but a Lambda layer uses it. It may cause errors. 'function_type') /usr/local/lib/python3.7/dist-packages/keras/layers/core/lambda_layer.py:299: UserWarning: cal_download.onnx2keras.elementwise_layers is not loaded, but a Lambda layer uses it. It may cause errors. 'function_type') /usr/local/lib/python3.7/dist-packages/keras/layers/core/lambda_layer.py:299: UserWarning: cal_download.onnx2keras.linear_layers is not loaded, but a Lambda layer uses it. It may cause errors. 'function_type') /usr/local/lib/python3.7/dist-packages/keras/layers/core/lambda_layer.py:299: UserWarning: cal_download.onnx2keras.activation_layers is not loaded, but a Lambda layer uses it. It may cause errors. 'function_type')
Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder_1:0", shape=(768,), dtype=float32) Tensor("Placeholder:0", shape=(3072,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder:0", shape=(1, 197, 3072), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(768,), dtype=float32) Tensor("Placeholder_1:0", shape=(1, 197, 768), dtype=float32) Tensor("Placeholder:0", shape=(1, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 151296), dtype=float32) Tensor("Placeholder_1:0", shape=(151296,), dtype=float32) Tensor("Placeholder:0", shape=(1, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 256), dtype=float32) Tensor("Placeholder_1:0", shape=(256,), dtype=float32) Tensor("Placeholder:0", shape=(1, 1), dtype=float32) Tensor("Placeholder_1:0", shape=(), dtype=float32) Tensor("Placeholder:0", shape=(1, 256), dtype=float32) Tensor("Placeholder_1:0", shape=(256,), dtype=float32) Tensor("backbone/261/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/263_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/266/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/267_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/270_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/269/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/285_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/284/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/311/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/319_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/333_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/332/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/341/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/343_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/346/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/347_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/350_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/349/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/353/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/355_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/361_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/360/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/369/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/371_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/374/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/375_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/378_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/377/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/393_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/392/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/419/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/427_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/441_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/440/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/449/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/451_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/454/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/455_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/458_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/457/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/461/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/463_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/469_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/468/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/477/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/479_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/482/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/483_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/486_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/485/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/501_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/500/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/527/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/535_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/549_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/548/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/557/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/559_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/562/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/563_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/566_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/565/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/569/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/571_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/577_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/576/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/585/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/587_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/590/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/591_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/594_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/593/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/609_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/608/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/635/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/643_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/657_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/656/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/665/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/667_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/670/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/671_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/674_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/673/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/677/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/679_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/685_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/684/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/693/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/695_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/698/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/699_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/702_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/701/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/717_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/716/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/743/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/751_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/765_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/764/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/773/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/775_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/778/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/779_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/782_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/781/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/785/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/787_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/793_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/792/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/801/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/803_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/806/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/807_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/810_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/809/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/825_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/824/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/851/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/859_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/873_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/872/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/881/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/883_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/886/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/887_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/890_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/889/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/893/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/895_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/901_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/900/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/909/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/911_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/914/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/915_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/918_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/917/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/933_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/932/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/959/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/967_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/981_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/980/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/989/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/991_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/994/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/995_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/998_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/997/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1001/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1003_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1009_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1008/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1017/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1019_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1022/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1023_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1026_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1025/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1041_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1040/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1067/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1075_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1089_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1088/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1097/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1099_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1102/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1103_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1106_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/1105/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1109/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1111_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1117_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1116/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1125/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1127_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1130/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1131_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1134_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1133/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1149_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1148/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1175/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1183_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1197_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1196/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1205/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1207_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1210/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1211_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1214_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/1213/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1217/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1219_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1225_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1224/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1233/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1235_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1238/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1239_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1242_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1241/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1257_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1256/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1283/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1291_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1305_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1304/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1313/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1315_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1318/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1319_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1322_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/1321/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1325/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1327_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1333_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1332/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1341/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1343_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1346/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1347_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1350_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1349/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1365_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1364/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1391/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1399_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1413_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1412/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1421/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1423_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1426/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1427_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1430_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/1429/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1433/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1435_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1441_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1440/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1449/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1451_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1454/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1455_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1458_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1457/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1473_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1472/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1499/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1507_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("backbone/1521_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1520/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1529/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("backbone/1531_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1534/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("backbone/1535_const2/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1538_const1/Const:0", shape=(3072,), dtype=float32) Tensor("backbone/1537/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1541/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("backbone/1543_const2/Const:0", shape=(), dtype=float32) Tensor("backbone/1549_const1/Const:0", shape=(768,), dtype=float32) Tensor("backbone/1548/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("head/17/Mean:0", shape=(1, 1), dtype=float32) Tensor("head/19_const2/Const:0", shape=(), dtype=float32) Tensor("head/22/Mul:0", shape=(1, 151296), dtype=float32) Tensor("head/23_const2/Const:0", shape=(151296,), dtype=float32) Tensor("head/30/Mean:0", shape=(1, 1), dtype=float32) Tensor("head/32_const2/Const:0", shape=(), dtype=float32) Tensor("head/35/Mul:0", shape=(1, 256), dtype=float32) Tensor("head/36_const2/Const:0", shape=(256,), dtype=float32) Tensor("head/43/Mean:0", shape=(1, 1), dtype=float32) Tensor("head/45_const2/Const:0", shape=(), dtype=float32) Tensor("head/48/Mul:0", shape=(1, 256), dtype=float32) Tensor("head/49_const2/Const:0", shape=(256,), dtype=float32) WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.
model.summary()
Model: "aff9616b-704e-4605-bf38-8e34dacdbd98" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= input (InputLayer) [(1, None, None, 3)] 0 tf_op_layer_channel_flip (T (1, None, None, 3) 0 ensorFlowOpLayer) resize_and_rescale (Sequent (1, 224, 224, 3) 0 ial) tf_op_layer_subtract_mean ( (1, 224, 224, 3) 0 TensorFlowOpLayer) tf_op_layer_DivNoNan (Tenso (1, 224, 224, 3) 0 rFlowOpLayer) tf_op_layer_Transpose (Tens (1, 3, 224, 224) 0 orFlowOpLayer) backbone (Functional) (1, 197, 768) 85525248 tf_op_layer_reshape (Tensor (1, 151296) 0 FlowOpLayer) head (Functional) (1, 3) 38798595 tf_op_layer_Sigmoid (Tensor (1, 3) 0 FlowOpLayer) ================================================================= Total params: 124,323,843 Trainable params: 124,323,843 Non-trainable params: 0 _________________________________________________________________
pil_img = Image.open(img_path)
plt.imshow(pil_img)
plt.show()
def preprocess_image(pil_img, input_width, input_height):
# Resize PIL image to (w, h) and convert to (1, h, w, 3) tensor
resized_img = pil_img.resize((input_width, input_height))
tensor_hwc = tf.keras.preprocessing.image.img_to_array(resized_img)
tensor_1hwc = tf.expand_dims(tensor_hwc, 0)
return tensor_1hwc
input_width = input_height = 224
tensor_1hwc = preprocess_image(pil_img, input_width, input_height)
tensor_1hwc.shape
TensorShape([1, 224, 224, 3])
prediction = model.predict(tensor_1hwc)
Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/261/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/263_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/266/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/267_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/270_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/269/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/285_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/284/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/311/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/319_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/333_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/332/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/341/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/343_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/346/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/347_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/350_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/349/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/353/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/355_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/361_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/360/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/369/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/371_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/374/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/375_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/378_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/377/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/393_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/392/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/419/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/427_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/441_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/440/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/449/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/451_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/454/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/455_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/458_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/457/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/461/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/463_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/469_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/468/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/477/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/479_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/482/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/483_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/486_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/485/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/501_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/500/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/527/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/535_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/549_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/548/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/557/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/559_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/562/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/563_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/566_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/565/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/569/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/571_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/577_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/576/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/585/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/587_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/590/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/591_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/594_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/593/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/609_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/608/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/635/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/643_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/657_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/656/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/665/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/667_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/670/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/671_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/674_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/673/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/677/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/679_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/685_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/684/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/693/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/695_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/698/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/699_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/702_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/701/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/717_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/716/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/743/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/751_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/765_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/764/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/773/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/775_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/778/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/779_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/782_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/781/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/785/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/787_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/793_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/792/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/801/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/803_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/806/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/807_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/810_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/809/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/825_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/824/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/851/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/859_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/873_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/872/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/881/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/883_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/886/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/887_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/890_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/889/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/893/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/895_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/901_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/900/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/909/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/911_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/914/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/915_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/918_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/917/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/933_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/932/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/959/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/967_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/981_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/980/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/989/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/991_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/994/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/995_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/998_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/997/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1001/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1003_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1009_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1008/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1017/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1019_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1022/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1023_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1026_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1025/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1041_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1040/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1067/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1075_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1089_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1088/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1097/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1099_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1102/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1103_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1106_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1105/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1109/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1111_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1117_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1116/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1125/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1127_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1130/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1131_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1134_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1133/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1149_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1148/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1175/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1183_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1197_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1196/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1205/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1207_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1210/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1211_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1214_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1213/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1217/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1219_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1225_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1224/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1233/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1235_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1238/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1239_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1242_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1241/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1257_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1256/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1283/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1291_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1305_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1304/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1313/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1315_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1318/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1319_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1322_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1321/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1325/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1327_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1333_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1332/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1341/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1343_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1346/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1347_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1350_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1349/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1365_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1364/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1391/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1399_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1413_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1412/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1421/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1423_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1426/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1427_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1430_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1429/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1433/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1435_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1441_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1440/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1449/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1451_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1454/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1455_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1458_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1457/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1473_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1472/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1499/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1507_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1521_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1520/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1529/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1531_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1534/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1535_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1538_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1537/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1541/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1543_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1549_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1548/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/17/Mean:0", shape=(1, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/19_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/22/Mul:0", shape=(1, 151296), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/23_const2/Const:0", shape=(151296,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/30/Mean:0", shape=(1, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/32_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/35/Mul:0", shape=(1, 256), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/36_const2/Const:0", shape=(256,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/43/Mean:0", shape=(1, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/45_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/48/Mul:0", shape=(1, 256), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/49_const2/Const:0", shape=(256,), dtype=float32)
2022-04-17 18:39:41.591418: I tensorflow/stream_executor/cuda/cuda_dnn.cc:366] Loaded cuDNN version 8101 2022-04-17 18:39:42.190140: I tensorflow/core/platform/default/subprocess.cc:304] Start cannot spawn child process: No such file or directory 2022-04-17 18:39:42.190924: I tensorflow/core/platform/default/subprocess.cc:304] Start cannot spawn child process: No such file or directory 2022-04-17 18:39:42.190944: W tensorflow/stream_executor/gpu/asm_compiler.cc:80] Couldn't get ptxas version string: INTERNAL: Couldn't invoke ptxas --version 2022-04-17 18:39:42.191753: I tensorflow/core/platform/default/subprocess.cc:304] Start cannot spawn child process: No such file or directory 2022-04-17 18:39:42.191962: W tensorflow/stream_executor/gpu/redzone_allocator.cc:314] INTERNAL: Failed to launch ptxas Relying on driver to perform ptx compilation. Modify $PATH to customize ptxas location. This message will be only logged once.
prediction[0]
array([9.9952102e-01, 4.4798324e-04, 2.0798518e-04], dtype=float32)
import time
from contextlib import contextmanager
# For type hints
from typing import Iterator, Callable
@contextmanager
def eval_latency() -> Iterator[Callable]:
t_start = time.time()
timer = lambda: time.time() - t_start
yield timer
with eval_latency() as timer:
prediction = model.predict(tensor_1hwc)
print(f'Elapsed time: {timer():.3f}s')
Elapsed time: 0.080s
from functools import partial
def predict_wrapper(pil_img, model):
return model(pil_img)
# Wrap the model for faster computation using tf.function
predict_tf_function = tf.function(partial(predict_wrapper, model=model))
# Preload the function
dummy_input = tf.zeros((1, input_height, input_width, 3))
_ = predict_tf_function(dummy_input)
Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/261/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/263_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/266/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/267_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/270_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/269/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/285_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/284/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/311/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/319_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/333_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/332/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/341/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/343_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/346/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/347_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/350_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/349/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/353/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/355_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/361_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/360/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/369/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/371_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/374/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/375_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/378_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/377/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/393_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/392/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/419/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/427_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/441_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/440/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/449/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/451_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/454/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/455_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/458_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/457/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/461/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/463_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/469_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/468/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/477/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/479_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/482/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/483_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/486_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/485/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/501_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/500/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/527/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/535_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/549_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/548/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/557/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/559_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/562/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/563_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/566_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/565/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/569/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/571_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/577_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/576/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/585/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/587_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/590/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/591_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/594_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/593/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/609_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/608/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/635/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/643_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/657_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/656/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/665/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/667_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/670/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/671_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/674_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/673/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/677/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/679_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/685_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/684/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/693/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/695_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/698/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/699_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/702_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/701/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/717_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/716/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/743/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/751_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/765_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/764/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/773/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/775_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/778/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/779_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/782_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/781/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/785/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/787_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/793_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/792/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/801/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/803_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/806/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/807_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/810_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/809/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/825_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/824/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/851/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/859_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/873_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/872/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/881/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/883_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/886/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/887_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/890_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/889/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/893/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/895_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/901_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/900/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/909/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/911_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/914/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/915_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/918_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/917/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/933_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/932/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/959/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/967_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/981_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/980/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/989/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/991_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/994/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/995_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/998_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/997/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1001/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1003_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1009_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1008/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1017/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1019_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1022/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1023_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1026_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1025/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1041_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1040/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1067/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1075_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1089_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1088/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1097/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1099_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1102/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1103_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1106_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1105/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1109/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1111_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1117_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1116/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1125/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1127_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1130/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1131_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1134_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1133/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1149_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1148/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1175/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1183_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1197_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1196/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1205/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1207_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1210/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1211_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1214_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1213/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1217/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1219_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1225_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1224/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1233/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1235_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1238/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1239_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1242_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1241/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1257_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1256/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1283/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1291_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1305_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1304/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1313/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1315_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1318/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1319_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1322_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1321/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1325/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1327_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1333_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1332/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1341/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1343_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1346/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1347_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1350_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1349/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1365_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1364/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1391/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1399_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1413_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1412/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1421/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1423_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1426/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1427_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1430_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1429/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1433/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1435_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1441_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1440/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1449/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1451_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1454/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1455_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1458_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1457/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1473_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1472/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1499/truediv:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1507_const2/Const:0", shape=(1, 12, 197, 197), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1521_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1520/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1529/Mean:0", shape=(1, 197, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1531_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1534/Mul:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1535_const2/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1538_const1/Const:0", shape=(3072,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1537/Tensordot:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1541/Erf:0", shape=(1, 197, 3072), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1543_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1549_const1/Const:0", shape=(768,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/backbone/1548/Tensordot:0", shape=(1, 197, 768), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/17/Mean:0", shape=(1, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/19_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/22/Mul:0", shape=(1, 151296), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/23_const2/Const:0", shape=(151296,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/30/Mean:0", shape=(1, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/32_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/35/Mul:0", shape=(1, 256), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/36_const2/Const:0", shape=(256,), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/43/Mean:0", shape=(1, 1), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/45_const2/Const:0", shape=(), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/48/Mul:0", shape=(1, 256), dtype=float32) Tensor("aff9616b-704e-4605-bf38-8e34dacdbd98/head/49_const2/Const:0", shape=(256,), dtype=float32)
def fast_predict(tensor_1hwc):
prediction = predict_tf_function(tensor_1hwc)
return prediction[0].numpy()
with eval_latency() as timer:
prediction = fast_predict(tensor_1hwc)
print(f'Elapsed time: {timer():.3f}s')
Elapsed time: 0.017s
import os, json
model_info_path = os.path.splitext(model_path)[0] + '.json'
model_info = json.load(open(model_info_path))
model_info
{'name': 'Pet Classification', 'category': 'Pet', 'type': 'radio', 'options': [{'name': 'Dog'}, {'name': 'Cat'}, {'name': 'Other'}], 'performances': [{'name': 'Dog', 'precision': 0.9996667777407531, 'recall': 0.9996667777407531, 'f_score': 0.9996667727407532}, {'name': 'Cat', 'precision': 0.9990009990009991, 'recall': 0.9990009990009991, 'f_score': 0.9990009940009992}, {'name': 'Other', 'precision': 0.0, 'recall': 0.0, 'f_score': 0.0}]}
def get_top1_class(prediction, model_info):
cls_index = prediction.argmax()
cls = model_info['options'][cls_index]
confidence = prediction[cls_index]
return { 'name': cls['name'], 'confidence': confidence }
get_top1_class(prediction, model_info)
{'name': 'Dog', 'confidence': 0.999521}
def get_all_classes(prediction, model_info):
return [
{ 'name': cls['name'], 'confidence': confidence }
for cls, confidence in zip(model_info['options'], prediction)
if confidence > cls.get('score_thres', 0)
]
get_all_classes(prediction, model_info)
[{'name': 'Dog', 'confidence': 0.999521}, {'name': 'Cat', 'confidence': 0.00044798324}, {'name': 'Other', 'confidence': 0.00020798518}]