Coder Social home page Coder Social logo

Comments (7)

nihui avatar nihui commented on August 16, 2024

matlab 是 col-major 存储的,如果模型是 matlab 训练的,里头的 weight 要变换下。。

from ncnn.

VivienFu avatar VivienFu commented on August 16, 2024

@nihui 答复神速啊,非常感谢!

我的模型不是用matlab训练的,就是caffe.exe跑得训练。后来发现是数据预处理不一致导致的。
太弱了,还没有好好理解ncnn。
处理方式记录在blog中了,http://blog.csdn.net/fuwenyan/article/details/76213015

from ncnn.

nihui avatar nihui commented on August 16, 2024

const float mean_vals[3] = { 127.5f, 127.5f, 127.5f };
const float norm_vals[3] = { 0.0078125f, 0.0078125f, 0.0078125f };
in.substract_mean_normalize(mean_vals, norm_vals);
这样应该也可以

from ncnn.

VivienFu avatar VivienFu commented on August 16, 2024

@nihui 原来如此!!!谢大神!

from ncnn.

Tomhouxin avatar Tomhouxin commented on August 16, 2024

@nihui ,如果mean_vals[3] = {104.f, 112.f, 121.f}呢,对应的norm_vals[3] 是怎么算的

from ncnn.

nihui avatar nihui commented on August 16, 2024

@nihui ,如果mean_vals[3] = {104.f, 112.f, 121.f}呢,对应的norm_vals[3] 是怎么算的

具体的 mean norm 要参考训练的设置
https://github.com/Tencent/ncnn/wiki/FAQ-ncnn-produce-wrong-result#pre-process

from ncnn.

jolt2017 avatar jolt2017 commented on August 16, 2024

const float mean_vals[3] = { 127.5f, 127.5f, 127.5f };
const float norm_vals[3] = { 0.0078125f, 0.0078125f, 0.0078125f };
in.substract_mean_normalize(mean_vals, norm_vals);
这样应该也可以

您好,这里不是很理解,为啥均值和方差和pytorch 训练模型时使用的不一致???

from ncnn.

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.