--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+unsubscribe@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/ace2ae78-51a8-4b70-a3ec-b0e6098c757b%40tensorflow.org.
w = dense1.get_weights() tf.print(tf.reshape(w[0],[1280*5]), summarize=-1)
and insert them in TFjs
const dense1 = tf.layers.dense({ inputShape: [1280], units: 5, activation: 'softmax', useBias: true, weights: [tf.tensor(w0, [1280,5]), tf.tensor(w1)] }) model = tf.sequential({ layers: [ dense1 ] });see "Classifying Flowers with CNNs and Transfer Learning" at
https://www.ibiblio.org/e-notes/ml/flowers.htm.
But may be Nikhil Thorat will add weights IO / serialization examples?
And didn't you see SSD/YOLO Colab Transfer Learning demos (with flowers detection better :)
Evgeny
--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/e2a98dc9-2f84-4b75-9602-d506379d72bd%40tensorflow.org.
to Shanqing Cai
for tf.keras model from Colab
...
URL = 'https://tfhub.dev/google/tf2-preview/mobilenet_v2/feature_vector/4'
feature_extractor = hub.KerasLayer(URL,
input_shape = (IMAGE_RES, IMAGE_RES, 3))model = tf.keras.Sequential([
feature_extractor,
layers.Dense(num_classes, activation='softmax')
])...
saved as model.h5 I get from tfjs_converter
error unknown layer: feature_extractor.
It is not very difficult to extract weights "by hand" butHow shall I use similar models in TFjs? orHow can I load binary weights from TF/Colab into TFjs?Evgeny
On Monday, January 13, 2020 at 5:56:03 PM UTC+3, Shanqing Cai wrote:If you just care about inference, you can save the keras model (presumably of the tf.keras flavor) as a TF SavedModel and convert it as a tf_graph_model with tensorflowjs_converter. Then the converted model can be loaded as a tf.GraphModel in TF.js for inference.Let me know if you have any questions.
--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/c4a82818-5bd9-4871-bbaf-42e119cee8ca%40tensorflow.org.