Skip to content

Commit 998f713

Browse files
Handle missing tensorflowjs package in unit tests (#1647)
Signed-off-by: Tom Wildenhain <[email protected]>
1 parent d6c3ebf commit 998f713

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/backend_test_base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,10 @@ def freeze_and_run_tf(self, func, feed_dict, outputs, as_session, premade_placeh
198198
return result, graph_def, initialized_tables
199199

200200
def convert_to_tfjs(self, graph_def_path, output_names):
201-
from tensorflowjs.converters import converter
201+
try:
202+
from tensorflowjs.converters import converter
203+
except ImportError:
204+
return None
202205
tfjs_path = os.path.join(self.test_data_directory, self._testMethodName + "_tfjs")
203206
try:
204207
converter.convert([graph_def_path, tfjs_path, '--input_format', 'tf_frozen_model',

0 commit comments

Comments
 (0)