Skip to content
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
10 changes: 5 additions & 5 deletions deepbrain/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from skimage.transform import resize
import os

PB_FILE = os.path.join(os.path.dirname(__file__), "models", "extractor", "graph_v2.pb")
CHECKPOINT_DIR = os.path.join(os.path.dirname(__file__), "models", "extractor", "v2")
PB_FILE = os.path.join(os.path.dirname(__file__), "models", "graph.pb")
CHECKPOINT_DIR = os.path.join(os.path.dirname(__file__), "models")


class Extractor:
Expand All @@ -15,9 +15,9 @@ def __init__(self):

def load_pb(self):
graph = tf.Graph()
self.sess = tf.Session(graph=graph)
with tf.gfile.FastGFile(PB_FILE, 'rb') as f:
graph_def = tf.GraphDef()
self.sess = tf.compat.v1.Session(graph=graph)
with tf.io.gfile.GFile(PB_FILE, 'rb') as f:
graph_def = tf.compat.v1.GraphDef()
graph_def.ParseFromString(f.read())
with self.sess.graph.as_default():
tf.import_graph_def(graph_def)
Expand Down