Git Product home page Git Product logo

Comments (4)

wang-xinyu avatar wang-xinyu commented on July 22, 2024

yolov5.py是什么文件?你自己写的吗

from tensorrtx.

chen-del avatar chen-del commented on July 22, 2024

是的我自己写的,我参照你们提供的模版去转化,发现唯独yolov5读取的时候直接报错了
就是类似使用python去实现这一段读取代码std::map<std::string, Weights> loadWeights(const std::string file)
{
std::cout << "Loading weights: " << file << std::endl;
std::map<std::string, Weights> weightMap;

// Open weights file
std::ifstream input(file);
assert(input.is_open() && "Unable to load weight file.");

// Read number of weight blobs
int32_t count;
input >> count;
assert(count > 0 && "Invalid weight map file.");

while (count--)
{
    Weights wt{DataType::kFLOAT, nullptr, 0};
    uint32_t size;

    // Read name and type of blob
    std::string name;
    input >> name >> std::dec >> size;
    wt.type = DataType::kFLOAT;

    // Load blob
    uint32_t* val = reinterpret_cast<uint32_t*>(malloc(sizeof(val) * size));
    for (uint32_t x = 0, y = size; x < y; ++x)
    {
        input >> std::hex >> val[x];
    }
    wt.values = val;
    
    wt.count = size;
    weightMap[name] = wt;
}

return weightMap;

}

from tensorrtx.

chen-del avatar chen-del commented on July 22, 2024

但是我不知道这个报错怎么去解决,它似乎是读取问题,案例其实就是参照了,yolov5-v7 src 里面的model.cpp 和resnet50.py,然后去实现这些操作

from tensorrtx.

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.