xinghaochen / TinySAM

Official PyTorch implementation of "TinySAM: Pushing the Envelope for Efficient Segment Anything Model"
Apache License 2.0
403 stars 23 forks source link

Unexpected warning of register_model #13

Closed lu-ming-lei closed 7 months ago

lu-ming-lei commented 10 months ago

UserWarning: Overwriting tiny_vit_5m_224 in registry with tinysam.modeling.tiny_vit_sam.tiny_vit_5m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected. return register_model(fn_wrapper)

I got several warings when running demo.py and this is my outcome. I want to know if the result is normal and if this warning can be ignored since my pytorch version is higher.

test

Gaffey commented 10 months ago

Hi @lu-ming-lei , we cannot reproduce this warning in our test environment. From the description of this warning, it could be caused by conflicts with other libraries which also use the function name tiny_vit_5m_224. Maybe you can solve this warning by creating a new virtual environment for TinySAM.

The final output seems normal and I think there is nothing to do with the version of PyTorch.

TimyWimey commented 10 months ago

@lu-ming-lei I also received the same warning, with 5 similar contents

tiny_vit_sam.py:656: UserWarning: Overwriting tiny_vit_5m_224 in registry with tinysam.modeling.tiny_vit_sam.tiny_vit_5m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.

May I ask if you solved this problem?

StevenHaojc commented 9 months ago

I receive the same problem too.

xinghaochen commented 7 months ago

You could simply ignore this warning. This warning occurs due to conflict names of the timm model and our model. See the registry function in timm for more details.

This warning does not affect the usage of TinySAM.