File upload not working under linux

#1
by nils-deybach - opened

Hi,

Thanks a lot to the hugging face community for such a quick up and running sam3 webgpu space !

However, when using it under linux (both a fedora 42 and a ubuntu 25.04 machine, I cannot upload (drag and drop ; and click)) any image.

Is this a bug specific to linux (I don't have a macos or windows under hand rn) ?

WebML Community org

Hmm, strange ๐Ÿ‘€ is there any error in the console? The source code is literally just https://huggingface.co/spaces/webml-community/SAM3-Tracker-WebGPU/blob/main/index.html, in case you are able to debug.

ort-wasm-simd-threaded.jsep.mjs:100 2025-11-28 09:48:14.018199 [W:onnxruntime:, session_state.cc:1280 VerifyEachNodeIsAssignedToAnEp] Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.
Bc @ ort-wasm-simd-threaded.jsep.mjs:100
$func11828 @ ort-wasm-simd-threaded.jsep.wasm:0xf9915f
$func1841 @ ort-wasm-simd-threaded.jsep.wasm:0x22df9c
$func810 @ ort-wasm-simd-threaded.jsep.wasm:0xb9ef0
$func11762 @ ort-wasm-simd-threaded.jsep.wasm:0xf92915
$func697 @ ort-wasm-simd-threaded.jsep.wasm:0x9f9bb
$func88 @ ort-wasm-simd-threaded.jsep.wasm:0xdb66
$func14346 @ ort-wasm-simd-threaded.jsep.wasm:0x12d4ecb
$func119 @ ort-wasm-simd-threaded.jsep.wasm:0x15503
$func1384 @ ort-wasm-simd-threaded.jsep.wasm:0x177a32
$func11276 @ ort-wasm-simd-threaded.jsep.wasm:0xf4d91f
$Ma @ ort-wasm-simd-threaded.jsep.wasm:0xae2f36
Hd.b. @ ort-wasm-simd-threaded.jsep.mjs:77
e._OrtCreateSession @ ort-wasm-simd-threaded.jsep.mjs:104
(anonymous) @ ort-wasm-simd-threaded.jsep.mjs:14
Du @ [email protected]:1
await in Du
rc @ [email protected]:1
loadModel @ [email protected]:1
createInferenceSessionHandler @ [email protected]:1
create @ [email protected]:1
await in create
_ @ [email protected]:1
(anonymous) @ [email protected]:1
await in (anonymous)
D @ [email protected]:1
from_pretrained @ [email protected]:1
await in from_pretrained
loadModel @ sam3.html:435
(anonymous) @ sam3.html:451
ort-wasm-simd-threaded.jsep.mjs:100 2025-11-28 09:48:14.019099 [W:onnxruntime:, session_state.cc:1282 VerifyEachNodeIsAssignedToAnEp] Rerunning with verbose output on a non-minimal build will show node assignments.
Bc @ ort-wasm-simd-threaded.jsep.mjs:100
$func11828 @ ort-wasm-simd-threaded.jsep.wasm:0xf9915f
$func1841 @ ort-wasm-simd-threaded.jsep.wasm:0x22df9c
$func810 @ ort-wasm-simd-threaded.jsep.wasm:0xb9ef0
$func11762 @ ort-wasm-simd-threaded.jsep.wasm:0xf92915
$func697 @ ort-wasm-simd-threaded.jsep.wasm:0x9f9bb
$func88 @ ort-wasm-simd-threaded.jsep.wasm:0xdb66
$func14346 @ ort-wasm-simd-threaded.jsep.wasm:0x12d4ecb
$func119 @ ort-wasm-simd-threaded.jsep.wasm:0x15503
$func1384 @ ort-wasm-simd-threaded.jsep.wasm:0x177f19
$func11276 @ ort-wasm-simd-threaded.jsep.wasm:0xf4d91f
$Ma @ ort-wasm-simd-threaded.jsep.wasm:0xae2f36
Hd.b. @ ort-wasm-simd-threaded.jsep.mjs:77
e._OrtCreateSession @ ort-wasm-simd-threaded.jsep.mjs:104
(anonymous) @ ort-wasm-simd-threaded.jsep.mjs:14
Du @ [email protected]:1
await in Du
rc @ [email protected]:1
loadModel @ [email protected]:1
createInferenceSessionHandler @ [email protected]:1
create @ [email protected]:1
await in create
_ @ [email protected]:1
(anonymous) @ [email protected]:1
await in (anonymous)
D @ [email protected]:1
from_pretrained @ [email protected]:1
await in from_pretrained
loadModel @ sam3.html:435
(anonymous) @ sam3.html:451
sam3.html:205 Error during encoding: ReferenceError: Cannot access 'processor' before initialization
at encode (sam3.html:198:17)
encode @ sam3.html:205
await in encode
(anonymous) @ sam3.html:366

WebML Community org

Weird, that should basically never happen because the file upload should be disabled until the session is ready.

I made this change: https://huggingface.co/spaces/webml-community/SAM3-Tracker-WebGPU/commit/6291a18b0a68a6106aac1552435b0e835c79bd7f
can you check if it's fixed? what browser are you using?

Chrome, Safari, Firefox, all on MacOS. It says extracting image when I click one of the samples but then nothing works. I can't attach my own image.

Errors in console:
refresh.js:27 WebSocket connection to 'ws://localhost:8081/' failed:
initClient @ refresh.js:27
addRefresh @ refresh.js:45
(anonymous) @ refresh.js:71
(anonymous) @ refresh.js:72
index.html:223 Error during encoding: ReferenceError: Cannot access 'processor' before initialization
at encode (index.html:215:17)
encode @ index.html:223
await in encode
(anonymous) @ index.html:418

WebML Community org

That did indeed make progress. Now it is able to segment the images that are in the preselected three. It also allows me to select an image from my own files, which is progress. The only issue now is that it won't upload those images to the UI and these errors occur. My suspicion is that this will be back and forth for a while, sorry for the game of telephone, thanks for getting the MVP running, no need to respond to all of this if you're busy doing other stuff. Thanks for all of the work!

[Info] Successfully preconnected to https://fonts.gstatic.com/
[Warning] cdn.tailwindcss.com should not be used in production. To use Tailwind CSS in production, install it as a PostCSS plugin or use the Tailwind CLI: https://tailwindcss.com/docs/installation (3.4.17, line 64)
[Error] 2025-11-29 12:39:14.696999 [W:onnxruntime:, session_state.cc:1280 VerifyEachNodeIsAssignedToAnEp] Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.
Bc (ort-wasm-simd-threaded.jsep.mjs:100:237)
.wasm-function[11828] .wasm-function[1841]
.wasm-function[810] .wasm-function[11762]
.wasm-function[697] .wasm-function[88]
.wasm-function[14346] .wasm-function[119]
.wasm-function[1384] .wasm-function[11276]
.wasm-function[7427] (anonymous function) (ort-wasm-simd-threaded.jsep.mjs:77:121) (anonymous function) (ort-wasm-simd-threaded.jsep.mjs:14) (anonymous function) ([email protected]:1:447155) [Error] 2025-11-29 12:39:14.696999 [W:onnxruntime:, session_state.cc:1282 VerifyEachNodeIsAssignedToAnEp] Rerunning with verbose output on a non-minimal build will show node assignments. Bc (ort-wasm-simd-threaded.jsep.mjs:100:237) .wasm-function[11828]
.wasm-function[1841] .wasm-function[810]
.wasm-function[11762] .wasm-function[697]
.wasm-function[88] .wasm-function[14346]
.wasm-function[119] .wasm-function[1384]
.wasm-function[11276] .wasm-function[7427]
(anonymous function) (ort-wasm-simd-threaded.jsep.mjs:77:121)
(anonymous function) (ort-wasm-simd-threaded.jsep.mjs:14)
(anonymous function) ([email protected]:1:447155)
[Error] 2025-11-29 12:39:15.648000 [W:onnxruntime:, session_state.cc:1280 VerifyEachNodeIsAssignedToAnEp] Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.
Bc (ort-wasm-simd-threaded.jsep.mjs:100:237)
.wasm-function[11828] .wasm-function[1841]
.wasm-function[810] .wasm-function[11762]
.wasm-function[697] .wasm-function[88]
.wasm-function[14346] .wasm-function[119]
.wasm-function[1384] .wasm-function[11276]
.wasm-function[7427] (anonymous function) (ort-wasm-simd-threaded.jsep.mjs:77:121) (anonymous function) (ort-wasm-simd-threaded.jsep.mjs:14) (anonymous function) ([email protected]:1:447155) [Error] 2025-11-29 12:39:15.648000 [W:onnxruntime:, session_state.cc:1282 VerifyEachNodeIsAssignedToAnEp] Rerunning with verbose output on a non-minimal build will show node assignments. Bc (ort-wasm-simd-threaded.jsep.mjs:100:237) .wasm-function[11828]
.wasm-function[1841] .wasm-function[810]
.wasm-function[11762] .wasm-function[697]
.wasm-function[88] .wasm-function[14346]
.wasm-function[119] .wasm-function[1384]
.wasm-function[11276] .wasm-function[7427]
(anonymous function) (ort-wasm-simd-threaded.jsep.mjs:77:121)
(anonymous function) (ort-wasm-simd-threaded.jsep.mjs:14)
(anonymous function) ([email protected]:1:447155)
[Error] Failed to load resource: the server responded with a status of 404 () (transformers.min.js.map, line 0)

WebML Community org

No worries ๐Ÿ˜€ Glad it's mostly working now. I'm not entirely sure about your dev environment and why it's not showing, but I imagine it's something an LLM can assist with.

For the warning Rerunning with verbose output on a non-minimal build will show node assignments., you can safely ignore that -- it's just saying that some ops aren't running on WebGPU.

You should be able to ignore [Error] Failed to load resource: the server responded with a status of 404 () (transformers.min.js.map, line 0) since that looks to just be a debug message from your browser.

Sign up or log in to comment