Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added use of os.path.join to concat files with filepath. #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions server/tools/process-local.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
import argparse
import json
import base64

import os

parser = argparse.ArgumentParser()
parser.add_argument("--model_dir", required=True, help="directory containing exported model")
parser.add_argument("--input_file", required=True, help="input PNG image file")
parser.add_argument("--output_file", required=True, help="output PNG image file")
a = parser.parse_args()


def main():
with open(a.input_file, "rb") as f:
input_data = f.read()
Expand All @@ -23,8 +24,9 @@ def main():
input_instance = json.loads(json.dumps(input_instance))

with tf.Session() as sess:
saver = tf.train.import_meta_graph(a.model_dir + "/export.meta")
saver.restore(sess, a.model_dir + "/export")

saver = tf.train.import_meta_graph(os.path.join(a.model_dir, "export.meta"))
saver.restore(sess, os.path.join(a.model_dir + "export"))
input_vars = json.loads(tf.get_collection("inputs")[0])
output_vars = json.loads(tf.get_collection("outputs")[0])
input = tf.get_default_graph().get_tensor_by_name(input_vars["input"])
Expand Down