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

Add Replicate demo and API #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ArielReplicate
Copy link

Hey @xuebinqin! 👋

Thank you for uploading the code and trained networks. It works easily and is very usefull.

This pull request makes it possible to run your model inside a Docker environment, which makes it easier for other people to run it. We're using an open source tool called Cog to make this process easier.

This also means we can make a web page where other people can run your model! View it here: https://replicate.com/arielreplicate/dichotomous_image_segmentation

Replicate also have an API, so people can easily run your model from their code:

import replicate
model = replicate.models.get("[arielreplicate/dichotomous_image_segmentation]")
model.predict(...)

Claim your page here so you can edit it, and we'll feature it on our website and tweet about it too.
We will also change the name of the the model from "arielreplicate/dichotomous_image_segmentation" to "xuebinqin/dichotomous_image_segmentation"

In case you're wondering who I am, I'm from Replicate, where we're trying to make machine learning reproducible. We got frustrated that we couldn't run all the really interesting ML work being done. So, we're going round implementing models we like. 😊

@DengPingFan
Copy link
Collaborator

Hey @xuebinqin! 👋

Thank you for uploading the code and trained networks. It works easily and is very usefull.

This pull request makes it possible to run your model inside a Docker environment, which makes it easier for other people to run it. We're using an open source tool called Cog to make this process easier.

This also means we can make a web page where other people can run your model! View it here: https://replicate.com/arielreplicate/dichotomous_image_segmentation

Replicate also have an API, so people can easily run your model from their code:

import replicate
model = replicate.models.get("[arielreplicate/dichotomous_image_segmentation]")
model.predict(...)

Claim your page here so you can edit it, and we'll feature it on our website and tweet about it too. We will also change the name of the the model from "arielreplicate/dichotomous_image_segmentation" to "xuebinqin/dichotomous_image_segmentation"

In case you're wondering who I am, I'm from Replicate, where we're trying to make machine learning reproducible. We got frustrated that we couldn't run all the really interesting ML work being done. So, we're going round implementing models we like. 😊

Hi,

The output messages are:
Output
CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 14.76 GiB total capacity; 13.48 GiB already allocated; 7.75 MiB free; 13.49 GiB reserved in total by PyTorch)

Maybe it needs to remove some files dynamically.

Best,

@ArielReplicate
Copy link
Author

Hi @DengPingFan,
Sorry for the very late reply.
It seems to work now on Replicate.com.
Can you check again and tell me if you'r still getting this error?

@radi-cho
Copy link

The error occurs after multiple successful generations. Something is probably adding up over time.

@radi-cho
Copy link

@ArielReplicate ArielReplicate#1 could optimize inference.

@ArielReplicate
Copy link
Author

Yes I see the crash after few trials.
Thanks @radi-cho I think using no_grad will help but probably wont solve the memory leak right?
@DengPingFan can you help on this? The inference code in the commit is quite simple. Where could the memory leak come from?

@radi-cho
Copy link

There is another version of this model on Replicate, which doesn't seem to have a memory leak. (However, it is slower to cold start and inference because of the added support for multiple additional file formats.) https://replicate.com/pratos/dis-v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants