Coder Social home page Coder Social logo

Comments (15)

briantse100 avatar briantse100 commented on August 16, 2024

@xialuxi @zys1994 Hi, how do you set the wing loss parameter? I have set the landmark label to [-1,1]. And I have set the wing loss parameter (w=0.3, e=2), it does not converge. As follow is the author suggestion.
I need python caffe version of wingloss
You can normalise the label to [0,1], but then you have to change the wing loss parameters and learning rate as well. I used a label in [0,64] for CNN6 and I did not normalise the wing loss by the number of batch size

from arcface-caffe.

zys1994 avatar zys1994 commented on August 16, 2024

(w=10,e=2) is fine

from arcface-caffe.

zys1994 avatar zys1994 commented on August 16, 2024

@xialuxi @briantse100
how to use Wingloss? when i use WingLoss layer like this

layer {
  name: "landmarkloss"
  type: "WingLoss"
  bottom: "fc4"
  bottom: "hdf_data"
  top: "landmarkloss"
  loss_weight: 1
  include {
    phase: TRAIN
  }
  wing_loss_param{
    w: 10
    epsilon: 2 
  }
}

when i train,it makes wrong

*** Aborted at 1561083953 (unix time) try "date -d @1561083953" if you are using GNU date ***
PC: @     0x7f32043cfa9e (unknown)
*** SIGSEGV (@0x10514f09c00) received by PID 20569 (TID 0x7f3206ffbac0) from PID 351312896; stack trace: ***
    @     0x7f32042924b0 (unknown)
    @     0x7f32043cfa9e (unknown)
    @     0x7f320630a8b0 caffe::WingLossLayer<>::Forward_gpu()
    @     0x7f320615bbc1 caffe::Net<>::ForwardFromTo()
    @     0x7f320615bcc7 caffe::Net<>::Forward()
    @     0x7f32062e1ee8 caffe::Solver<>::Step()
    @     0x7f32062e2a8a caffe::Solver<>::Solve()
    @           0x40e54b train()
    @           0x40a6dd main
    @     0x7f320427d830 __libc_start_main
    @           0x40b139 _start
    @                0x0 (unknown)
^C

from arcface-caffe.

xialuxi avatar xialuxi commented on August 16, 2024

你试一下使用cpu模式,看正不正常?

from arcface-caffe.

zys1994 avatar zys1994 commented on August 16, 2024

cpu目前可以train,不过速度很慢 。 gpu版本是出了什么问题吗

from arcface-caffe.

xialuxi avatar xialuxi commented on August 16, 2024

等我有时间了改一下就好了。

from arcface-caffe.

briantse100 avatar briantse100 commented on August 16, 2024

@zys1994, 可以参考faster-rcnn中的smoothL1loss

from arcface-caffe.

xialuxi avatar xialuxi commented on August 16, 2024

WingLossForward 里面这样写会存在问题,gpu多线程对同一个变量操作了。

from arcface-caffe.

xialuxi avatar xialuxi commented on August 16, 2024

将输出Dtype* out 改成, blob结构, 算完之后,再相加!

from arcface-caffe.

zys1994 avatar zys1994 commented on August 16, 2024

cpu train了半天才6000个batch。期待你把gpu版本的改好来训 哈哈

from arcface-caffe.

xialuxi avatar xialuxi commented on August 16, 2024

1, 你可以使用gpu训练, 只要把loss层的gpu代码屏蔽掉就行了,训练速度影响很小。
2、我稍微修改了下代码, 但是我没有测试,你可以自己试一试。

from arcface-caffe.

zys1994 avatar zys1994 commented on August 16, 2024

make all -j 的时候报错了

src/caffe/layers/wing_loss_layer.cpp:28:47: error: ‘one_dot_data’ was not declared in this scope
void WingLossLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top)
{
    w = this->layer_param_.wing_loss_param().w();
    DCHECK(w > 0);
    epsilon = this->layer_param_.wing_loss_param().epsilon();
    DCHECK(epsilon >= 0);


    //_c = w * (1.0 - log(1.0 + w/epsilon)
    _c = w * (1.0 - log(1.0 + w/epsilon));

   // has_ignore_label_ = this->layer_param_.loss_param().has_ignore_label();
   // if (has_ignore_label_)
   // {
   //     ignore_label_ = this->layer_param_.loss_param().ignore_label();
   // }
    log_abs.ReshapeLike(*bottom[0]);
    caffe_set(bottom[0]->count(), Dtype(1.0), one_dot_data);
}

这里面最后一句的one_dot_data在哪声明

from arcface-caffe.

xialuxi avatar xialuxi commented on August 16, 2024

from arcface-caffe.

zys1994 avatar zys1994 commented on August 16, 2024

改了之后make可以通过, 但用cpu,gpu 在train都会报错
用EuclideanLoss是可以跑的,应该还是Wingloss有点问题

F0622 10:32:27.929319 17830 blob.cpp:133] Check failed: data_ 
*** Check failure stack trace: ***
    @     0x7f44f71c15cd  google::LogMessage::Fail()
    @     0x7f44f71c3433  google::LogMessage::SendToLog()
    @     0x7f44f71c115b  google::LogMessage::Flush()
    @     0x7f44f71c3e1e  google::LogMessageFatal::~LogMessageFatal()
    @     0x7f44f79bf5eb  caffe::Blob<>::mutable_cpu_data()
    @     0x7f44f798a60d  caffe::WingLossLayer<>::LayerSetUp()
    @     0x7f44f7845027  caffe::Net<>::Init()
    @     0x7f44f784776e  caffe::Net<>::Net()
    @     0x7f44f79b735a  caffe::Solver<>::InitTrainNet()
    @     0x7f44f79b8825  caffe::Solver<>::Init()
    @     0x7f44f79b8b3f  caffe::Solver<>::Solver()
    @     0x7f44f79aaaf1  caffe::Creator_AdamSolver<>()
    @           0x40d98a  train()
    @           0x40a6dd  main
    @     0x7f44f5957830  __libc_start_main
    @           0x40b139  _start
    @              (nil)  (unknown)

from arcface-caffe.

zys1994 avatar zys1994 commented on August 16, 2024

@xialuxi 目前在用wingloss train的时候报错可以帮忙看看吗?

from arcface-caffe.

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.