Code Monkey home page Code Monkey logo

Comments (6)

albertfaromatics avatar albertfaromatics commented on May 13, 2024 12

The fix is to convert to long the "gain" of the gridspace on declaration.

In all lines with
gain = torch.ones(7, device=targets.device)

change to
gain = torch.ones(7, device=targets.device).long()

For some reason newest versions of cuda/torch do not do this cast automatically when needed

from yolov7.

abbass-zain-eddine avatar abbass-zain-eddine commented on May 13, 2024 6

I just updated the line 388 in the loss.py to become:
indices.append((b, a, gj.clamp_(0,int(gain[3]) - 1), gi.clamp_(0, int(gain[2]) - 1)))
and it works, without changing the pytorch version.
I am training yolov5 polygon

from yolov7.

ggggggaa avatar ggggggaa commented on May 13, 2024

result type Float can't be cast to the desired output type __int64

same issues

from yolov7.

WongKinYiu avatar WongKinYiu commented on May 13, 2024

Python-3.8.10 torch-1.12.0+cu102 CUDA:0

My environment, torch 1.12 is OK, do you use Python 3.9?

from yolov7.

ggggggaa avatar ggggggaa commented on May 13, 2024

from yolov7.

ggggggaa avatar ggggggaa commented on May 13, 2024

from yolov7.

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.