Git Product home page Git Product logo

Comments (4)

rencheng123456 avatar rencheng123456 commented on June 25, 2024

你好,我最近也在研究使用TensorRT来加速YOLO v2模型,想问下,但不知道如何着手。希望能给予我一些指导

from tensorrt_tutorial.

jsmlay avatar jsmlay commented on June 25, 2024

TensorRT 3.0 Have YOLO plugins headers. Plz double check before usage.
Find it in NvInferPlugin.h in /usr/src/TensorRT/include.
It need Jetpack 3.2 support.
When deploy it, you need to write plugin, plz refer to FasterRCNN sample.
Sorry for using English because i'm on TX2.

from tensorrt_tutorial.

LitLeo avatar LitLeo commented on June 25, 2024

抱歉最近没怎么关注git。BN的实现可以用scale层代替,直接将BN层的公式转换成scale层公式就可以了。我之前的实现代码如下,仅供参考。

                float *scale_values = new float[l_ptr->out_c];
                float *shift_values = new float[l_ptr->out_c];
                for (int i = 0; i < l_ptr->out_c; ++i)
                {
                    scale_values[i] = 1 / (sqrt(l_ptr->rolling_variance[i] + .00001f)) * l_ptr->scales[i];
                    shift_values[i] = -l_ptr->rolling_mean[i] / (sqrt(l_ptr->rolling_variance[i] + .00001f)) * l_ptr->scales[i] + l_ptr->biases[i];
                }
                Weights scale {DataType::kFLOAT, scale_values, l_ptr->out_c};
                Weights shift {DataType::kFLOAT, shift_values, l_ptr->out_c};
                Weights power {DataType::kFLOAT, nullptr, 0};

                auto scale_1 = network->addScale(*inputs_v[0], ScaleMode::kCHANNEL, shift, scale, power);
                assert(scale_1 != nullptr);
                inputs_v[0] = scale_1->getOutput(0);

from tensorrt_tutorial.

wuxler avatar wuxler commented on June 25, 2024

已经解决了,非常感谢!

from tensorrt_tutorial.

Related Issues (12)

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.