Skip to content
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

TFJS Converter unsupported Ops #692

Closed
thekevinscott opened this issue Sep 10, 2018 · 3 comments · Fixed by tensorflow/tfjs-core#1307
Closed

TFJS Converter unsupported Ops #692

thekevinscott opened this issue Sep 10, 2018 · 3 comments · Fixed by tensorflow/tfjs-core#1307
Assignees

Comments

@thekevinscott
Copy link
Contributor

thekevinscott commented Sep 10, 2018

TensorFlow.js version

0.5.7 (This is the version installed via pip; tfjs-converter's version is 0.5.9)

Browser version

N/A

Describe the problem or feature request

tensorflowjs_converter reports unsupported ops

Code to reproduce the bug / link to feature request

https://colab.research.google.com/drive/1dg7OopsWXTK1qRfXvY4w_tI3zBj3D9dj

I'm trying to convert Universal Sentence Encoders and Elmo from Tensorflow Hub, as shown in this colab doc. Each fail with a number of unsupported ops. For example, universal-sentence-encoder-lite fails with unsupported ops:

ValueError: Unsupported Ops in the model before optimization
FloorMod, SplitV, SparseToDense, GatherNd, Prod, ScatterNd, ListDiff, BatchMatMul

It looks like FloorMod should be supported, but it's not on 0.5.7.

I'd like to request SplitV, SparseToDense, GatherNd, and ScatterNd as supported ops.

The rest of the ops are tracked in other issues.

Thanks!
Kevin

@loretoparisi
Copy link

loretoparisi commented Sep 12, 2018

@caisq I'm adding to the unsupported operations: ReverseSequence, Prod, ListDiff, BatchMatMul

ValueError: Unsupported Ops in the model before optimization
ReverseSequence, Prod, ListDiff, BatchMatMul

I was trying to use tfjs-converter to convert this GRU G2P trained model from the SessionBundle format.

@pyu10055
Copy link
Collaborator

pyu10055 commented Oct 9, 2018

@thekevinscott @loretoparisi The List Diff Op has been renamed to SetDiff1D, can you verify for your model this op is still been used? Thanks!

@thekevinscott
Copy link
Contributor Author

thekevinscott commented Oct 10, 2018

@pyu10055 It looks like ListDiff is still being used by v2 of universal-sentence-encoder-lite on TFHub:

Here's a colab.

Pip-installed tensorflowjs_converter version is: 0.6.2

Running tensorflowjs_converter --input_format=tf_hub 'https://tfhub.dev/google/universal-sentence-encoder-lite/2' universal-sentence-encoder-lite:

Using TensorFlow backend.
Creating a model with inputs ['dense_shape', 'values', 'indices'] and outputs ['module_apply_default/Encoder_en/hidden_layers/l2_normalize'].
Traceback (most recent call last):
  File "/usr/local/bin/tensorflowjs_converter", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/tensorflowjs/converters/converter.py", line 286, in main
    strip_debug_ops=FLAGS.strip_debug_ops)
  File "/usr/local/lib/python3.6/dist-packages/tensorflowjs/converters/tf_saved_model_conversion.py", line 422, in convert_tf_hub_module
    skip_op_check=skip_op_check, strip_debug_ops=strip_debug_ops)
  File "/usr/local/lib/python3.6/dist-packages/tensorflowjs/converters/tf_saved_model_conversion.py", line 113, in optimize_graph
    ', '.join(unsupported))
ValueError: Unsupported Ops in the model before optimization
ScatterNd, SparseToDense, Prod, ListDiff, GatherNd

The non-lite version of Universal Sentence Encoder does not have ListDiff (though it does also fail to convert with many more missing ops)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants