def test_layerwise(self): load_frozen = GraphFromFrozen(TF_MODELS["identity"].path) modify_tf = ModifyGraph(load_frozen, outputs=constants.MARK_ALL) graph, outputs = modify_tf() assert graph assert outputs
def test_load_graph(self): with tf.compat.v1.Graph().as_default() as graph: inp = tf.placeholder(shape=(1, 1, 1, 1), dtype=tf.float32) out = tf.identity(inp) graph, outputs = func.invoke(GraphFromFrozen(graph)) assert graph assert outputs
def test_save_tensorboard(self): with tempfile.TemporaryDirectory() as outdir: tf_loader = SaveGraph(GraphFromFrozen(TF_MODELS["identity"].path), tensorboard_dir=outdir) tf_loader() assert os.path.exists(tf_loader.tensorboard_dir)
def test_save_pb(self): with tempfile.NamedTemporaryFile() as outpath: tf_loader = SaveGraph(GraphFromFrozen(TF_MODELS["identity"].path), path=outpath.name) tf_loader() check_file_non_empty(outpath.name)
def test_load_pb(self): tf_loader = GraphFromFrozen(TF_MODELS["identity"].path) tf_loader()