Broken tensor on specific GPU
See original GitHub issueSystem information
-
Have I written custom code: https://codesandbox.io/s/tfjs-unstack-issue-loz5r?file=/src/index.js
-
OS Platform and Distribution: Windows 10 GPU: WebGL:
-
TensorFlow.js version: 3.0.0
-
Browser version: Chrome 88.0.4324.146
Describe the current behavior With WebGL backend this code returns broken tensor:
const frameSourceRaw = tf.tensor3d(
new Int32Array(Array(128 * 224 * 4).fill(225)),
[128, 224, 4],
"int32"
);
const unstacked = tf.unstack(frameSourceRaw, -1);
unstacked.forEach((a) => a.print());
is printed:
[[225, 225, 225, ..., 225, 225, 225],
[225, 225, 225, ..., 225, 225, 225],
[225, 225, 225, ..., 225, 225, 225],
...,
[0 , 0 , 0 , ..., 0 , 0 , 0 ],
[0 , 0 , 0 , ..., 0 , 0 , 0 ],
[0 , 0 , 0 , ..., 0 , 0 , 0 ]]
while frameSourceRaw is correct.
This behavior does not appear only after unstacked
operation, but also after other (slice
, div
).
More examples: https://codesandbox.io/s/tfjs-unstack-issue-loz5r?file=/src/index.js
Zeros appear after 65536 (2^16) element. With CPU backend or with other GPU or with other array dimensions (eg. 144 * 256) output tensor is correct.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
How to set specific gpu in tensorflow? - Stack Overflow
"0" is here the name of the GPU you want to use. You can have the list of the GPU available by typing...
Read more >How to select GPU programmatically in code #1901 - GitHub
Hi, I found this https://github.com/pytorch/examples/pull/73/files to set an env variable to choose GPU. Is there a way to manually choose ...
Read more >How to make sure Tensors stay in the same GPU - distributed
Hi everyone! I just have a question regarding how can I make sure that the tensors will stay in the same device.
Read more >Tips for Optimizing GPU Performance Using Tensor Cores
This is due to how GPUs store and access data. Layers that don't meet this requirement are still accelerated on the GPU. However,...
Read more >How to create a CPU tensor and GPU tensor in Pytorch
This is achieved by using .device function in which we have to mention the device that we want to use "CPU" or "GPU"....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like the tensor texture might be exceeding the max texture limit 16384, which translate to 16384 * 4 = 65536, since we are packing the tensor into 4 channels of the texture. Can you try to disable the packing and see if the 0 values appears at 1/4 of the size.
Are you satisfied with the resolution of your issue? Yes No