-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
TensorFlow.js version
0.8.0
Browser version
Chrome 65.0.3325.181
Describe the problem or feature request
When loading a Tensorflow SavedModel including a pad using the loadFrozenModel function and run a simple execution it will give an error Uncaught (in promise) Error: Failed to compile fragment shader.. After some investigating it seems like the paddings value are injected as an 1D array where it should be 2D. E.g. paddings [[0, 0], [2, 0]] are injected as [0, 0, 2, 0]. This results in the map function at https://github.com/tensorflow/tfjs-core/blob/75b2596a46db8560a6d27b62397dacf366a9347e/src/kernels/webgl/pad_gpu.ts#L34 to output a list of NaNs. As far as I can see the paddings are checked when building your own model using tfjs here https://github.com/tensorflow/tfjs-core/blob/23970ba5876d54c704b8e40ffe07f976e725c45a/src/ops/array_ops.ts#L779, so I suspect it might have to do with loading the model from a (Tensorflow) SavedModel. The weightManifest in the model shows that the paddings are loaded with (correct) shape [2, 2].
Unfortunately I'm not familiar enough with the code base to PR it myself.
Code to reproduce the bug / link to feature request
See above