--
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.
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/dfcf3615-d3fc-40b6-8843-241d5c264a39%40tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/CABYDHeNztfBhJp40S%3D07gz1VQEPov5NqD-KXP7FPg9i59fnw1A%40mail.gmail.com.
Hi @caisq,
Found out the reasons for tfjs converted model not producing the correct inference...at last :)
Reasons:
1. Input to LSTM model had NaN in them! Though I was passing the extracted features from MobileNet model to LSTM, features.**dataSync() was not used**. Because of this, when I added the extracted features into a tf.buffer they were added as NaN. (when I printed values in log just before adding to tf.buffer, they printed values correctly!...this is strange). So, when I used dataSync() on the extracted features, they got added into tf.buffer correctly.
2. **Use of tf.buffer() to store the extracted features** (from MobileNet) and converting them to tensors before passing to LSTM model. Instead I used tf.stack() to store the extracted features and then passed the stacked tensor to LSTM model. (I understand that tf.stack() does the equivalent of np.array())
Thanks anyways for your time.
BTW, Doc for dataSync() says **'This blocks the UI thread until the values are ready, which can cause performance issues'**. So, is it safe to use? In my case, code did not work without dataSync()...so, wondering if there is any other replacement/equivalent method for dataSync() that will not create performance issue. Let me know.
Also, I noticed some minor differences in predictions between python model and tfjs model on few occasions. Is this supposed to happen? or am I missing something?
Regards,
Jay
--
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.
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/CABYDHePmQ_YYyoRyss25XEhRnQrhkrW4zJFPbBGdLRS1txUsww%40mail.gmail.com.
I created an empty tf.buffer with the shape I want and then using .set() method of tf.buffer to set extracted feature values in it. This strangely set NaNs in the tf.buffer. Hope this clarifies your doubt.
--
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.
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/CAKGNCat_ALWsT35G4Ntay3nSHeZSqe9S844qqgwNkOb3QGPOag%40mail.gmail.com.