8000 contrastive_loss_layer.cpp has a very little bug (I think) · Issue #128 · alexgkendall/caffe-segnet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
contrastive_loss_layer.cpp has a very little bug (I think) #128
Open
@SuaiChen

Description

@SuaiChen

I met an error just like below:

src/caffe/layers/contrastive_loss_layer.cpp:56:22: error: no matching function for call to 'max'
        Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), 0.0);
                     ^~~~~~~~
src/caffe/layers/contrastive_loss_layer.cpp:118:19: note: in instantiation of member function 'caffe::ContrastiveLossLayer<float>::Forward_cpu' requested here
INSTANTIATE_CLASS(ContrastiveLossLayer);
                  ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:2611:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('float' vs. 'double')
max(const _Tp& __a, const _Tp& __b)
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:2603:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
max(const _Tp& __a, const _Tp& __b, _Compare __comp)

I revised the 56th row.

Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), Dtype(0.0));

And it can work. My computer is Macpro and my system version is 10.13.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0