Giter Site home page Giter Site logo

Comments (4)

VCasecnikovs avatar VCasecnikovs commented on June 5, 2024

Hello,
thank you for this issue.

As I understand you are referring to this lines of code:

loss_conf_obj = F.binary_cross_entropy(pred_conf[obj_mask], tconf[obj_mask])
loss_conf_noobj = F.binary_cross_entropy(pred_conf[noobj_mask], tconf[noobj_mask])

I haven't tried to use autocast on this model yet, because my colegue had disappointing results using half precision with OD tasks. As I understand, to make these changes we should replace pred_conf with prediction[..., 4] and also replace 1 with e and 0 with 1. I do not think that this operation would be so time-consuming to not do it.

I would be happy if you would do a pull request with an example of autocasting to this repository.

If you are referring to the iou_all_to_all function. This function calculates Intersection over union for two tensors of boxes. It is used to calculate iou for the nearest bboxes, which are its neighboring ground-truth objects, which are not its target, to make repulsion, and also for prediction bboxes to repulse prediction bbox from others with the different target. As it is described in https://arxiv.org/pdf/1711.07752.pdf.
I haven't tried to autocast this function and I do not understand how it can be replaced with binary_cross_entropy_with_logits.

Best regards,
Vadims.

from yet-another-yolov4-pytorch.

bsugerman avatar bsugerman commented on June 5, 2024

Yes, those are the code lines.

As I understand you are referring to this lines of code:

loss_conf_obj = F.binary_cross_entropy(pred_conf[obj_mask], tconf[obj_mask])
loss_conf_noobj = F.binary_cross_entropy(pred_conf[noobj_mask], tconf[noobj_mask])

pytorch autocasting works very well on codes I've used and developed, and yields a significant increase in speed and memory usage. I'm tinkering with using your code with autocasting and will try the different cross-entropy method and let you know if I find anything promising.

from yet-another-yolov4-pytorch.

VCasecnikovs avatar VCasecnikovs commented on June 5, 2024

Hope you will find something good. If you will have anything to pool request, I would be really happy.

from yet-another-yolov4-pytorch.

VCasecnikovs avatar VCasecnikovs commented on June 5, 2024

Maybe You had same as this #11 problem

from yet-another-yolov4-pytorch.

Related Issues (20)

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.