This file contains hidden or 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
| pip install grpcio-tools | |
| wget https://github.com/tensorflow/tensorflow/archive/v1.9.0.zip -O tf-190.zip | |
| unzip tf-190.zip && rm tf-190.zip | |
| wget https://github.com/tensorflow/serving/archive/1.9.0.zip -O tf-serving-190.zip | |
| unzip tf-serving-190.zip && rm tf-serving-190.zip | |
| mv serving-1.9.0/tensorflow_serving tensorflow-1.9.0 |
This file contains hidden or 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 google.cloud import storage | |
| from airflow.hooks.base_hook import BaseHook | |
| from airflow.utils.log.logging_mixin import LoggingMixin | |
| import random | |
| import string | |
| class GCSCustomHook(BaseHook, LoggingMixin): | |
| def __init__(self, storage_conn_id='google_cloud_storage_default'): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| ''' Script for downloading all GLUE data. | |
| Note: for legal reasons, we are unable to host MRPC. | |
| You can either use the version hosted by the SentEval team, which is already tokenized, | |
| or you can download the original data from (https://download.microsoft.com/download/D/4/6/D46FF87A-F6B9-4252-AA8B-3604ED519838/MSRParaphraseCorpus.msi) and extract the data from it manually. | |
| For Windows users, you can run the .msi file. For Mac and Linux users, consider an external library such as 'cabextract' (see below for an example). | |
| You should then rename and place specific files in a folder (see below for an example). | |
| mkdir MRPC | |
| cabextract MSRParaphraseCorpus.msi -d MRPC |
This file contains hidden or 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 os, argparse | |
| import tensorflow as tf | |
| from tensorflow.python.framework import graph_util | |
| dir = os.path.dirname(os.path.realpath(__file__)) | |
| def freeze_graph(model_folder, output_nodes='y_hat', | |
| output_filename='frozen-graph.pb', | |
| rename_outputs=None): |
This file contains hidden or 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
| // Tensorflow Serving Go client for the inception model | |
| // go get github.com/golang/protobuf/ptypes/wrappers google.golang.org/grpc | |
| // | |
| // Compile the proto files: | |
| // | |
| // git clone https://github.com/tensorflow/serving.git | |
| // git clone https://github.com/tensorflow/tensorflow.git | |
| // | |
| // mkdir -p vendor |
This file contains hidden or 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
| # Copyright 2017 Google Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| import numpy as np | |
| import xml.etree.ElementTree as ET | |
| from pycocotools.coco import COCO | |
| def convert_coco_bbox(size, box): | |
| dw = 1. / size[0] | |
| dh = 1. / size[1] | |
| x = box[0] + box[2] / 2.0 |
This file contains hidden or 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: | |
| name: grommet-drone | |
| namespace: drone | |
| labels: | |
| app: grommet-drone | |
| annotations: | |
| description: drone with interface | |
| spec: |
This file contains hidden or 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
| # testing variable order init | |
| import tensorflow as tf | |
| def initialize_all_variables(sess=None): | |
| """Initializes all uninitialized variables in correct order. Initializers | |
| are only run for uninitialized variables, so it's safe to run this multiple | |
| times. | |
| Args: |