-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Demo demo failed to start #608
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
Comments
The first error seems to come from missing the onnx model file, while the second error comes from missing the image embedding. It sounds like you got the model part working, but just to be sure, the instructions for how to do this can be found on the demo readme, under the Export the ONNX model section. It's more or less just running through the onnx example notebook. I ran into issues exporting the quantized model, due to the The instructions for generating the image embedding are also in the demo readme, under the Export the image embedding section. Unlike creating the model, you have to add/modify the notebook code in order to save the embedding, specifically the line that's missing from the notebook is: np.save("dogs_embedding.npy", image_embedding) This can be added to the onnx notebook, about mid-way down in the 'Using an ONNX model' section, just after the Anyways, after placing the model + embedding files in the appropriate folders, you should be able to re-run the demo (using |
Thank you very much for your reply. I have successfully solved the problem
…---- Replied Message ----
| From | ***@***.***> |
| Date | 11/02/2023 23:50 |
| To | ***@***.***> |
| Cc | ***@***.***>***@***.***> |
| Subject | Re: [facebookresearch/segment-anything] Demo demo failed to start (Issue #608) |
The first error seems to come from missing the onnx model file, while the second error comes from missing the image embedding.
It sounds like you got the model part working, but just to be sure, the instructions for how to do this can be found on the demo readme, under the Export the ONNX model section. It's more or less just running through the onnx example notebook. I ran into issues exporting the quantized model, due to the quantize_dynamic(...) function being given the argument optimize=True, which apparently isn't valid (at least with the onnx version I installed...?), commenting out that argument prevents the error and the model seems to work fine without it.
The instructions for generating the image embedding are also in the demo readme, under the Export the image embedding section. Unlike creating the model, you have to add/modify the notebook code in order to save the embedding, specifically the line that's missing from the notebook is:
np.save("dogs_embedding.npy", image_embedding)
This can be added to the onnx notebook, about mid-way down in the 'Using an ONNX model' section, just after the image_embedding = ... line. The notebook uses the truck image by default, which you may want to change as well (you have to modify the image that is loaded, which you change in the 'Example Image' section, with image = cv2.imread('path/to/image.jpg')).
Anyways, after placing the model + embedding files in the appropriate folders, you should be able to re-run the demo (using yarn start) and have it work without those errors.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I haven't seen that sort of warning before, so I'm not really sure of a solution. However, one thing that would be worth trying is to downgrade the install requirements. The SAMv1 repo was released over a year ago and it may be that newer versions of packages have breaking changes compared to what was available when the repo was first released. That error seems like it might be javascript related, so you could try removing the |
same error,how to fix |
There's a similar question/solutions in the comments on issue #777 |
what should i do,there are something wrong |
That error is the same as the original post, as far as I can tell. |
I feel like there's something missing in it.


I created a model file
There was this mistake again. Is there a god who knows how to run this demo process?
The text was updated successfully, but these errors were encountered: