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

TensorFlowJS Unsupported Ops needed for Yahoo's Open NSFW Model #433

Closed
tomslick opened this issue Jun 15, 2018 · 7 comments
Closed

TensorFlowJS Unsupported Ops needed for Yahoo's Open NSFW Model #433

tomslick opened this issue Jun 15, 2018 · 7 comments
Assignees

Comments

@tomslick
Copy link

To get help from the community, check out our Google group.

TensorFlow.js version

tensorflowjs 0.4.1
(installed via pip install tensorflowjs on June 13, 2018)

Browser version

N/A

Describe the problem or feature request

I attempted to convert the TensorFlow model of Yahoo's Open NSFW model found here with tensorflowjs-convert. (First, I exported the TensorFlow .npy file into a Frozen Model and also a Saved Model.)

For the Frozen Model, I ran:

tensorflowjs_converter --input_format=tf_frozen_model --output_node_names='fc_nsfw/BiasAdd' --saved_model_tags=serve frozen_open_nsfw.pb web_model

and received the following message:

Unsupported Ops in the model
TensorArrayWriteV3, TensorArrayV3, DecodeBase64, TensorArrayScatterV3, TensorArrayReadV3, EncodeJpeg, Assert, All, TensorArraySizeV3, DecodeJpeg, Unpack, TensorArrayGatherV3

Running on the Saved Model also results in the same Unsupported Ops list.

Request: Please add my vote to support these Ops

  • TensorArrayWriteV3
  • TensorArrayV3
  • DecodeBase64
  • TensorArrayScatterV3
  • TensorArrayReadV3
  • EncodeJpeg
  • Assert
  • All
  • TensorArraySizeV3
  • DecodeJpeg
  • Unpack (I noticed this was added earlier today but not yet in the latest pip installed version)
  • TensorArrayGatherV3

Thanks!

@pyu10055
Copy link
Collaborator

The TensorArray related ops are almost ready, see tensorflow/tfjs-converter#170
All op has been added. The ops left are:
DecodedBase64, EncodeJpeg, Assert
We will add those to our priority list.

@tomslick
Copy link
Author

Thanks! That's amazing progress!

Also, don't forget DecodeJpeg please.

@rstml
Copy link

rstml commented Oct 6, 2018

Same issue here. The only outstanding ops are: DecodeBase64, DecodeJpeg, EncodeJpeg

@nsthorat nsthorat added the P2 label Oct 26, 2018
@xue160709
Copy link

Same issue here. The only outstanding ops are: DecodeBase64, DecodeJpeg, EncodeJpeg

@SSaishruthi
Copy link

Working on it.

@rstml
Copy link

rstml commented Mar 15, 2019

@SSaishruthi Frankly, if OpenNSFW is the only reason for supporting those operations, you may reconsider it.

For everyone else requesting this:

OpenNSFW has not been updated since its announcement in 2016. There are now alternative models which you can use.

We trained our alternative, MobileNetV2 based model which you can find here: https://github.com/purify-ai/geacc-models
TFJS example using this model is available here: https://github.com/purify-ai/geacc-tfjs-demo
Chrome extension which uses TFJS and our model: https://github.com/purify-ai/geacc-crx
We plan to release updated dataset and model soon (potentially 100K images).

There's also NsfwJS which is based on InceptionV3: https://github.com/infinitered/nsfwjs

@pyu10055
Copy link
Collaborator

DecodeJpeg op has been added in tfjs-node.

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

No branches or pull requests

6 participants