Skip to content
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

Can't run webgpu-video-background-removal example #1119

Open
1 of 5 tasks
chmjkb opened this issue Dec 27, 2024 · 0 comments
Open
1 of 5 tasks

Can't run webgpu-video-background-removal example #1119

chmjkb opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@chmjkb
Copy link

chmjkb commented Dec 27, 2024

System Info

  • Apple Macbook M1 Pro
  • Browser: Arc 131.0.6778.205
  • macOS Sequoia 15.1
  • transformers.js: 2.17.2

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

I tried to run the webgpu video background removal example and I've encountered two issues:

Uncaught SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at getModelJSON (@xenova_transformers.js?v=1e7f008e:14370:15)
    at async loadConfig (@xenova_transformers.js?v=1e7f008e:18834:14)
    at async PretrainedConfig.from_pretrained (@xenova_transformers.js?v=1e7f008e:18864:26)
    at async AutoModel.from_pretrained (@xenova_transformers.js?v=1e7f008e:21908:14)
    at async main.js:33:13

Which i managed to fix by setting env.allowLocalModels to false. However, then i encountered another error:

Uncaught Error: no available backend found. ERR: [wasm] TypeError: Cannot read properties of undefined (reading 'buffer')
    at resolveBackend (@xenova_transformers.js?v=1e7f008e:166:13)
    at async _InferenceSession.create (@xenova_transformers.js?v=1e7f008e:764:25)
    at async constructSession (@xenova_transformers.js?v=1e7f008e:19513:12)
    at async Promise.all (:5173/index 1)
    at async PreTrainedModel.from_pretrained (@xenova_transformers.js?v=1e7f008e:19900:14)
    at async AutoModel.from_pretrained (@xenova_transformers.js?v=1e7f008e:21924:14)
    at async main.js:33:13

Which is surprising, since i expected it to run on WebGPU instead of WASM.
I tried different versions of transformers.js but couldn't fix it though.
Thank you for creating this awesome library! :D

Reproduction

  1. go into webgpu-video-background-removal dir
  2. run yarn && yarn dev
@chmjkb chmjkb added the bug Something isn't working label Dec 27, 2024
@chmjkb chmjkb changed the title Can't run webgpu-video-background-removal Can't run webgpu-video-background-removal example Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant