Skip to content

Commit 956c727

Browse files
Updated LPIPS Class for TF2 Compatibility
Changed deprecated TF1 calls to their respective TF2 counterparts
1 parent 786fe1a commit 956c727

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models/hific/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,14 +846,14 @@ def __init__(self, weight_path):
846846
def wrap_frozen_graph(graph_def, inputs, outputs):
847847
def _imports_graph_def():
848848
tf.graph_util.import_graph_def(graph_def, name="")
849-
wrapped_import = tf.wrap_function(_imports_graph_def, [])
849+
wrapped_import = tf.compat.v1.wrap_function(_imports_graph_def, [])
850850
import_graph = wrapped_import.graph
851851
return wrapped_import.prune(
852852
tf.nest.map_structure(import_graph.as_graph_element, inputs),
853853
tf.nest.map_structure(import_graph.as_graph_element, outputs))
854854

855855
# Pack LPIPS network into a tf function
856-
graph_def = tf.GraphDef()
856+
graph_def = tf.compat.v1.GraphDef()
857857
with open(weight_path, "rb") as f:
858858
graph_def.ParseFromString(f.read())
859859
self._lpips_func = tf.function(

0 commit comments

Comments
 (0)