sam-hq icon indicating copy to clipboard operation
sam-hq copied to clipboard

Error when trying to load embedding image in browser using onnx

Open moneyhotspring opened this issue 1 year ago • 3 comments

Error: input 'interm_embeddings' is missing in 'feeds'. at d.run (ort.min.js:6:1) at runONNX (App.tsx:118:1) at App.tsx:96:1 at commitHookEffectListMount (react-dom.development.js:23150:1) at commitPassiveMountOnFiber (react-dom.development.js:24931:1) at commitPassiveMountEffects_complete (react-dom.development.js:24891:1) at commitPassiveMountEffects_begin (react-dom.development.js:24878:1) at commitPassiveMountEffects (react-dom.development.js:24866:1) at flushPassiveEffectsImpl (react-dom.development.js:27039:1) at flushPassiveEffects (react-dom.development.js:26984:1)

moneyhotspring avatar Sep 02 '23 20:09 moneyhotspring

same same here

crapthings avatar Dec 06 '23 09:12 crapthings

i've tried the original sam exporting, its working. but same process to export onnx doesn't work with official react demo.

i think maybe its in different form?

image

maybe convert these code to javascript? but how?

embed_size = sam.prompt_encoder.image_embedding_size

encoder_embed_dim_dict = {"vit_b":768,"vit_l":1024,"vit_h":1280}
encoder_embed_dim = encoder_embed_dim_dict[model_type]


"interm_embeddings": torch.randn(4, 1, *embed_size, encoder_embed_dim, dtype=torch.float),

crapthings avatar Dec 06 '23 09:12 crapthings

image

its working, but slow

crapthings avatar Dec 06 '23 11:12 crapthings