-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Some bugs related to tensor data lost during execution in the browser #8338
Comments
Thank you for bringing this issue to our attention and To help us investigate further, if it's convenient, would you be able to share your GitHub repository or a code snippet containing the model (zipped format)? Additionally, if possible, could you please outline the steps to reproduce the behavior on our end? This information would greatly expedite our troubleshooting process. Thank you for your cooperation and patience. |
The info for the model structure has already been given before, and the source code running on TensorFlow.js is in the attached HTML file. A sample of the model format is also in the zip. We use the tfjs-converter to convert the model from TensorFlow to TensorFlow.js. The converted model runs in the browser. These issues frequently occur when the browser cache is not disabled and occasionally occur when the browser cache is disabled. Our preliminary analysis suggests that these bugs are related to the browser cache reuse mechanism. The reuse of the browser cache causes disturbances in the browser environment, leading to these bugs. We hope the developers can provide the necessary explanations and analysis. |
Any further confirm? |
I apologize for the delay in my response, I checked your provided
After that could you please guide me with complete steps to replicate the same behavior from our end to investigate this issue further ? Thank you for your cooperation and patience. |
conda create -n DLMOSA python=3.9 Create a TensorFlow model according to the given model structure above and convert it to a TensorFlow.js model. Use the attached HTML file to execute the converted TensorFlow.js model. |
Hi @DeepLearningMOSA , Sorry for delay in my response. I am able to replicate the issue you are facing. I successfully converted the model file into the To test the issue, I specified dummy input tensors using the following code:
By adjusting the input shape, the model successfully predicts the output correctly each time without any issues. Could you please provide the input tensors you're using in your code? Thank You!! |
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you. |
This issue was closed due to lack of activity after being marked stale for past 7 days. |
Some tensor data are lost during execution.
System information
Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
TensorFlow.js installed from (npm or script link): script link
TensorFlow.js version (use command below): 3.19.0
Browser version: Microsoft Edge 125.0.2535.67(64 bit)、Google Chrome 125.0.6422.112 (64 bit)
Tensorflow.js Converter Version: -
Exception Report
{ "model_inf": "from:0 to:1 operator:identity from:1 to:2 operator:identity from:1 to:8 operator:max_pooling2D from:2 to:3 operator:identity from:3 to:4 operator:identity from:4 to:5 operator:identity from:5 to:6 operator:identity from:6 to:7 operator:identity from:7 to:8 operator:identity from:8 to:9 operator:reducemean ",
"error_message": "Error: Based on the provided shape, [2], the tensor should have 2 values but has 1\n at gv (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:116089)\n at iy (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:170406)\n at ay (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:169961)\n at yw (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:228810)\n at t. (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:699318)\n at u (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:104674)\n at Generator._invoke (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:104427)\n at forEach.t. [as next] (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:105031)\n at Wm (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:109975)\n at o (https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js:17:110179)"
}
Bug Description
Based on the provided shape, [2], the tensor should have 2 values but has 1. However, the same model executes perfectly in TensorFlow. Is there any tensor data lost during TensorFlow.js execution or converting? Maybe there are some faults in the implementation of the operator ReduceMean?
Similar faults are also reproduced under 6 other operators(e.g, Convolution, Padding, etc). This tensor data lost is triggered occasionally, which depends on condition of the cache in the browser. Maybe there are some faults in the cache reuse mechanism of the browser(e.g., latent refreshing)?
The text was updated successfully, but these errors were encountered: