Can we talk about TF-Hub downloading to TensorflowJS

Can someone comment on V5 downloading of TF-HUB models to TensorflowJS, I am not sure but things seem to have changed in the last year. I am most interested in fine-tuning which I thought needed to be uploaded using

const model = await tf.loadLayersModel

and frozen models converted from Tensorflow saved models could only be uploaded using

const model = await tf.loadGraphModel(modelUrl, {fromTFHub: true});

but V5 on TF-HUB seems to have fine-tunable Tensorflow Saved models, but the JS v1 and V3 versions only show the GraphModel load method which I thought was for frozen models.

tf-hub link here

I guess my question is, how do I find fine-tunable Layers models from TF-HUB?

Searching more I did find a JS(V5) here

but it is using the Graph Model Load which as far as I know is frozen

const model = await tf.loadGraphModel(
    'https://tfhub.dev/google/tfjs-model/imagenet/mobilenet_v3_large_100_224/feature_vector/5/default/1',
    { fromTFHub: true });

Any opinions? I want to search, find and load layers models from TF-HUB?

@lgusm May know more about TFHub discoverability for models

thanks Jason!

Hi Jeremy,

As of today we don’t have a search with this specific criteria (graph vs layered).

These models you mention specifically, could not be converted to LayersModels. I believe LayersModels can only be made from Keras models, which was not the case here. They are fine tuneable on regular TF only.

However, you can still “train” from any TFJS feature vector model using a KNN classifier. Tutorial: 전이 학습 이미지 분류자  |  TensorFlow.js (go to colab step 7)

does it makes sense?

1 Like