hustvl / Matte-Anything

[Image and Vision Computing (Vol.147 Jul. '24)] Interactive Natural Image Matting with Segment Anything Models
MIT License
465 stars 33 forks source link

Can't initiate the VitMatte model #17

Open musja007 opened 9 months ago

musja007 commented 9 months ago

Hi all!

I'm trying to run the matte_anything.py in Google Collab but get the following error:


`Initializing models... Please wait...

AssertionError                            Traceback (most recent call last)

[<ipython-input-8-a4065ac3ce58>](https://localhost:8080/#) in <cell line: 30>()
     28 print('Initializing models... Please wait...')
     29 
---> 30 vitmatte = init_vitmatte(vitmatte_model)

4 frames

[/content/Matte-Anything/modeling/decoder/detail_capture.py](https://localhost:8080/#) in __init__(self, in_chans, img_chans, convstream_out, fusion_out)
    110     ):
    111         super().__init__()
--> 112         assert len(fusion_out) == len(convstream_out) + 1
    113 
    114         self.convstream = ConvStream(in_chans = img_chans)

AssertionError:`

My initial thought was that it is related to the torch version, so I made sure I have a correct one: 2.0.0+cu117, but the error still persists.

Thanks in advance!

YeL6 commented 9 months ago

Thank you for your interest in our work! We appreciate your question!

I have reproduced your question and updated the MatteAnything/modeling/decoder/detail_capture.py files to fix the bug.

You can check in the new commit and update your code, I hope this works for you!