burn icon indicating copy to clipboard operation
burn copied to clipboard

Panic in example image-classification-web when activate 2 times Wgpu backend

Open Mathiskrvl opened this issue 1 year ago • 3 comments

Describe the bug We can't use 2 times the function "init_async::<AutoGraphicsApi>(&device).await;" panic : image_classification_web.js:478 panicked at burn\burn-compute\src\compute.rs:77:17: Client already created for device BestAvailable

To Reproduce Steps to reproduce:

  1. Activate the GPU - WebGPU in dropdown
  2. Activate an other backend in the dropdown
  3. Activate again the GPU - WebGPU in dropdown
  4. See error in console

Mathiskrvl avatar Feb 09 '24 13:02 Mathiskrvl

I'm not sure what we should do, should we just ignore the init_async function or panic as right now?

nathanielsimard avatar Feb 10 '24 16:02 nathanielsimard

Thank you for reporting it.

antimora avatar Feb 10 '24 19:02 antimora

I'm not sure what we should do, should we just ignore the init_async function or panic as right now?

At very least, we should:

  1. Document on the WGPU behavior if this is how it is supposed to behave.
  2. We should fix the example to account for the expected behavior in WGPU.

antimora avatar Feb 10 '24 20:02 antimora