Tfjs: Tensorflow Hub module (example) for converter not working

Created on 6 May 2018  路  7Comments  路  Source: tensorflow/tfjs

Using the latest TensorFlow.js version


Using the example for the Tensorflow Hub module example from the converter does not work.

Code for bash, according to example is:

$ tensorflowjs_converter \
    --input_format=tf_hub \
    'https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/classification/1' \
    /mobilenet/web_model

But I get the error:

AttributeError: 'Namespace' object has no attribute 'output_dir'

Using help of the converter, it requires a structure like:

TensorFlow.js model converters. [-h] --input_format
                                       {tf_frozen_model,tensorflowjs,keras,tf_hub,tf_saved_model,tf_session_bundle}
                                       [--output_format {tensorflowjs,keras}]
                                       [--output_node_names OUTPUT_NODE_NAMES]
                                       [--saved_model_tags SAVED_MODEL_TAGS]
                                       [--quantization_bytes {1,2}]
                                       input_path output_path

I tried to put the output_path like instructed by the structure above, but the I get:

error: unrecognized arguments: /Users/..

Has anybody else encountered this?
Do you know a solution?
I would like to fix it, if somebody could tell me what the problem is.

Thanks

Most helpful comment

You'll have to wait for the implementations

All 7 comments

There's a typo, rename output_dir to output_path inside converter.py. After that I get an error if i set the output folder but it works

@seranus What's the version of tensorflowjs pip package that you are using? The latest version is 0.3.0. Older versions do not have the TF Hub conversion feature.

@caisq The 0.3.0 that I manually downloaded from releases

I am also using the 0.3.0 version:

Name: tensorflowjs
Version: 0.3.0
Summary: Python Libraries and Tools for TensorFlow.js
Home-page: https://js.tensorflow.org/
Author: Google LLC
Author-email: [email protected]
License: Apache 2.0
Location: /Users/danieldeutsch/Desktop/code/EuLaw/converterForTfJs/lib/python2.7/site-packages
Requires: numpy, keras, tensorflow, tensorflow-hub, h5py, six
Required-by:

@seranus Will try your suggestion. Thanks

After changing the typo and fixing another reference error, I get:

Instructions for updating:
Use the retry module or similar alternatives.
2018-05-07 14:54:55.895245: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Converted 1 variables to const ops.
Unsupported Ops in the module
NotEqual, StringToHashBucketFast, ResourceGather, LookupTableFindV2, StridedSlice, SparseFillEmptyRows, SparseSegmentSqrtN, Unique, LookupTableSizeV2, StringSplit, HashTableV2

So these ops
NotEqual, StringToHashBucketFast, ResourceGather, LookupTableFindV2, StridedSlice, SparseFillEmptyRows, SparseSegmentSqrtN, Unique, LookupTableSizeV2, StringSplit, HashTableV2
or these
NotEqual, StringToHashBucketFast, FloorMod, ResourceGather, DynamicPartition, LookupTableFindV2, Size, StridedSlice, SparseFillEmptyRows, SparseSegmentSqrtN, FloorDiv, Unique, LookupTableSizeV2, ParallelDynamicStitch, StringSplit, HashTableV2
are not supported.

Where should I open an issue so they will be supported?
I will open a PR for the errors concerning the issues ;)

You'll have to wait for the implementations

Can you try this again because we have a lot more support, and would you please file issues for individual ops that we do not support? Thanks so much :)

Was this page helpful?
0 / 5 - 0 ratings