- Get the input and output tensor name from the model
- Create a tensorflow model builder
# Create SavedModelBuilder class # defines where the model will be exported export_path_base = MODEL_PATH export_path = os.path.join( tf.compat.as_bytes(export_path_base), tf.compat.as_bytes(str(VERSION_NUMBER)))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
torch.cuda.set_device(0) | |
# In[2]: | |
import torch | |
from detectron2 import model_zoo | |
from detectron2.engine import DefaultPredictor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from detectron2.utils.logger import setup_logger | |
from glob import glob | |
setup_logger() | |
import copy | |
from detectron2.evaluation import COCOEvaluator, inference_on_dataset | |
from detectron2.data import build_detection_test_loader | |
from detectron2 import model_zoo | |
from detectron2.config import get_cfg | |
from detectron2.config import CfgNode as CN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"heroname": "Spirit Breaker", | |
"player": "demon", | |
"mmr": "7624", | |
"link": "https://www.youtube.com/watch?v=Y6XAojzW86o", | |
"published": "2021-04-21 00:00:00", | |
"position": "4" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
# service type | |
kind: Service | |
metadata: | |
# Service name | |
labels: | |
run: myresnet-service | |
name: myresnet-service | |
spec: | |
ports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
# App name | |
name: myresnet-deployment | |
spec: | |
# Creating two pods | |
replicas: 2 | |
template: | |
metadata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import requests | |
from datetime import datetime | |
import argparse | |
from tensorflow_serving.apis import predict_pb2 | |
from tensorflow_serving.apis import prediction_service_pb2_grpc | |
import grpc | |
import tensorflow as tf | |
tf_v = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tensorflow_model_server --port=8500 --rest_api_port=8501 --model_name=resnet --model_base_path=/models/resnet |
Reference here
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
Reference 'https://medium.com/@avinchintha/how-to-install-nvidia-drivers-and-cuda-10-0-for-rtx-2080-ti-gpu-on-ubuntu-16-04-18-04-ce32e4edf1c0' with modification
sudo apt-get purge nvidia-*
NewerOlder