Giter Site home page Giter Site logo

grounding-dino-finetuning's Introduction

👋 My name is Asad I like to write code, train vision and multimodal ML models and deploy them in production

🚀 Feel free to contibute to one of my existing projects or reach out for colaboration on a project.

grounding-dino-finetuning's People

Contributors

asad-ismail avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

grounding-dino-finetuning's Issues

Issue in using the generated Fine-tuned weight file

I followed the document to set the library code. I generated my custom dataset as provided in the sample CSV file.

I used the groundingdino_swint_ogc.pth pre-trained model for the finetuning purpose and its corresponding config file. I ran the train.py provided in this code for training and the new weights were saved in my machine.

However, the issue appeared when I tried to test the model using the test.py file provided in this code. I configured the model path to the generated fine-tuned model while trying to predict a test image.

The Error is as below:
File "Grounding-Dino-FineTuning\groundingdino\util\inference.py" in Line number 37:
model.load_state_dict(clean_state_dict(checkpoint["model"]), strict=False)
KeyError: 'model'

Let me know how this issue can be rectified. Could the train.py script be missing something?

test the trained model

hello!thanks for your code, that's useful! However, I have several problems during the training process. 1) How much data did you use in fine-tuning? 2) When I used the fine-tuned model to test, I got more than 800 detection boxes, but there were only 3 objects in the image actually. Have you met this situation? I hope you can help with this. Thank you again and best wishes!

Fine-tune the code

hello,
Is the fine-tuning code (train.py) not complete enough for normal training?

error: UnpicklingError: invalid load key, 'v'.

/content/Grounding-Dino-FineTuning/groundingdino/models/GroundingDINO/ms_deform_attn.py:31: UserWarning: Failed to load custom C++ ops. Running on CPU mode Only!
warnings.warn("Failed to load custom C++ ops. Running on CPU mode Only!")
/usr/local/lib/python3.10/dist-packages/torch/functional.py:507: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3549.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
final text_encoder_type: bert-base-uncased
Traceback (most recent call last):
File "/content/Grounding-Dino-FineTuning/train.py", line 11, in
model = load_model("groundingdino/config/GroundingDINO_SwinT_OGC.py", "weights/groundingdino_swint_ogc.pth")
File "/content/Grounding-Dino-FineTuning/groundingdino/util/train.py", line 40, in load_model
checkpoint = torch.load(model_checkpoint_path, map_location="cpu")
File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1040, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1258, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.