learnopencv icon indicating copy to clipboard operation
learnopencv copied to clipboard

howerver, the from groundingdino.util.train file does not exit

Open djj-gyx opened this issue 6 months ago • 5 comments

howerver, the from groundingdino.util.train file does not exit

djj-gyx avatar Jun 05 '25 08:06 djj-gyx

Can you provide more details, please?

What demo/sample/source code are you referring to?

Which OperatingSystem, which Python version do you use?

How have you set-up your environment? In a Python virtual environment, Cona, or natively? Which versions of the modules have you unstalled, which installation instructions have you followed?

brmarkus avatar Jun 05 '25 10:06 brmarkus

@brmarkus I encountered the same problem. I followed the instructions from both your README and IDEA-Research/GroundingDino. I think the issue may be that GroundingDino has been updated—even on the GroundingDino GitHub page, util.train no longer exists: https://github.com/IDEA-Research/GroundingDINO/blob/main/groundingdino/util/utils.py But I really want to use your method to fine tune GroudningDino. Could you possibly open-source util.train?

Cuiyvvv avatar Oct 30 '25 12:10 Cuiyvvv

Someone might need to find out which commit/branch/tag was the last one working. Referencing dependencies without specifying a version/commit/branch is risky.

brmarkus avatar Oct 30 '25 14:10 brmarkus

There is no file such as train.py in the repo since the first commit.

refer to this https://github.com/IDEA-Research/GroundingDINO/issues/241

this is official response which contain some repos with fine-tuning/training implementation

NOXious48 avatar Nov 24 '25 23:11 NOXious48

Looks like you need to follow the blog from https://github.com/spmallick/learnopencv referencing https://learnopencv.com/fine-tuning-grounding-dino/ with:

The above code snippet defines a train function that loads annotations, initializes an Adam optimizer, and iterates over each epoch and image. For every image, it zeroes gradients, calls train_image to compute the loss given image tensors, bounding-box targets, and captions, backpropagates, steps the optimizer, accumulates and logs the loss, and periodically saves the model weights.

brmarkus avatar Nov 25 '25 07:11 brmarkus