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

DPTForDepthEstimation class could not be matched #160

Closed
pratos opened this issue Feb 14, 2023 · 4 comments
Closed

DPTForDepthEstimation class could not be matched #160

pratos opened this issue Feb 14, 2023 · 4 comments

Comments

@pratos
Copy link

pratos commented Feb 14, 2023

Hi, I was trying out depth estimation model via bumblebee (below is the code block):

{:ok, midas} = Bumblebee.load_model(
  {:hf, "Intel/dpt-hybrid-midas",
  cache_dir: bumblebee_cache_dir,
  auth_token: hf_token
  }
)

But I got an error:

** (RuntimeError) could not match the class name "DPTForDepthEstimation" to any of the supported models, please specify the :module and :architecture options
    (bumblebee 0.1.2) lib/bumblebee.ex:287: Bumblebee.load_spec/2
    (bumblebee 0.1.2) lib/bumblebee.ex:401: Bumblebee.load_model/2
    /Users/prthamesh/pratos-workbook.livemd#cell:vempkrw5zvjaonanodmtiiyi3xed4cza:1: (file)

I'm assuming this error is coz bumblebee is not on parity with huggingface libraries. Is there any way I can directly import .ckpt models or a way to contribute to bumblebee wrt the depth estimation model?

@josevalim
Copy link
Contributor

Hi @pratos! I believe you are correct, we would need to implement the model in Bumblebee. You can look at how other models are implemented for guidance. Perhaps resnet as a starting point?

@jonatanklosko
Copy link
Member

Correct, what's missing is the implementation of DPT (it is based on ViT, which we do have, so that's a good reference) and then a featurizer (matching DPTFeatureExtractor in hf/transformers) :)

@pratos
Copy link
Author

pratos commented Feb 15, 2023

Thanks for the info 😄! I'd see if I can get time to dive into this. I just started learning Elixir & don't have much experience writing pytorch arch from scratch! But would be an interesting exercise for me to go through 😀

Will checkout resnet & ViT in bumblebee first!

@jonatanklosko
Copy link
Member

Moved to #188.

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

No branches or pull requests

3 participants