Skip to content

Fix tfjs CI failure and add tfjs convert log #1797

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

Merged
merged 2 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions tests/backend_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,18 @@ def convert_to_tfjs(self, graph_def_path, output_names):
try:
from tensorflowjs.converters import converter
except ImportError:
self.logger.warning("Tensorflowjs.converters package imports failed.")
return None
tfjs_path = os.path.join(self.test_data_directory, self._testMethodName + "_tfjs")
try:
converter.convert([graph_def_path, tfjs_path, '--input_format', 'tf_frozen_model',
'--output_node_names', ','.join(output_names)])
except ValueError:
self.logger.warning("Convert tensorflowjs graph failed.")
return None
model_path = os.path.join(tfjs_path, 'model.json')
if not os.path.exists(model_path):
self.logger.warning("Tensorflowjs model path %s is empty.", model_path)
return None
return model_path

Expand Down
2 changes: 2 additions & 0 deletions tests/test_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def func(x, y):
output_names_with_port = ["output:0"]
self.run_test_case(func, feed_dict, input_names_with_port, output_names_with_port)

@skip_tfjs("TFJS issue, cannot read properties of undefined (reading 'name')")
def test_case_with_exclusive(self):
x_val = np.array([1, 2, 3], dtype=np.float32)
y_val = np.array([4, 5, 6], dtype=np.float32)
Expand All @@ -174,6 +175,7 @@ def func(x, y):
output_names_with_port = ["output:0"]
self.run_test_case(func, feed_dict, input_names_with_port, output_names_with_port)

@skip_tfjs("TFJS issue, cannot read properties of undefined (reading 'name')")
def test_case_without_default_branch(self):
def func(x, y):
x = tf.add(x, 1, name="add_x")
Expand Down