google-research / pix2seq

Pix2Seq codebase: multi-tasks with generative modeling (autoregressive and diffusion)
Apache License 2.0
857 stars 71 forks source link

speed too slow #5

Closed lucasjinreal closed 2 years ago

lucasjinreal commented 2 years ago

takes about 3 mins doesn't get result:

image

chentingpc commented 2 years ago

Is this run on colab (cloud) or local ipython notebook? If this is the first time the mode is called, it's likely stuck at downloading and restoring the model.

lucasjinreal commented 2 years ago

the download model shouldn't complete already in the previous cell in code lab? Anyway, how's the speed compare with DETR in local?

chentingpc commented 2 years ago

the code in colab is currently not run in eager mode so it will download and load the model when it is first run.

we haven't properly compared the inference time with DETR, but the speed difference depends on a few things such as encoder vs decoder's compute portion (for large images encoder may take more time), the number of objects to generate (autoregressive model could take significantly longer when predicting lots of objects, or longer sequences).

chenxwh commented 2 years ago

the code in colab is currently not run in eager mode so it will download and load the model when it is first run.

@chentingpc,

Hi, is there a way to download and load the model prior to the first inference so even the first run can be fast enough?

Thank you!

chentingpc commented 2 years ago

I'm not sure what'd be the best way to speed up model download in Google colab. But if you're running on a local machine, you could try to use gsutil cp -r gs://cloud_folder local_folder to download manually which may be faster.