【问题标题】:mlpack error while building构建时出现 mlpack 错误
【发布时间】:2017-03-22 23:11:16
【问题描述】:

安装 libmlpack-dev 后出现以下错误,将其包含在我的程序中并编译它。

/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp: In member function ‘void mlpack::kmeans::KMeans<MetricType, InitialPartitionPolicy, EmptyClusterPolicy, LloydStepType, MatType>::Cluster(const MatType&, size_t, arma::mat&, bool)’:
/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp:178:20: error: call of overloaded ‘isnan(double&)’ is ambiguous
 if (isnan(cNorm) || isinf(cNorm))
                ^
/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp:178:20: note: candidates are:
In file included from /usr/include/features.h:374:0,
             from /usr/include/x86_64-linux-gnu/sys/types.h:25

有人可以建议如何解决这个问题。

P.S : 我已经问过这个了 https://askubuntu.com/questions/847048/mlpack-error-while-building

【问题讨论】:

    标签: package ubuntu-14.04 mlpack


    【解决方案1】:

    这是旧版本 Ubuntu 上 mlpack 的问题。如果您将 Ubuntu 升级到较新版本并更新 mlpack 包,则该问题应该得到解决。但如果你无法做到这一点,你可以直接编辑文件/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp 使该行

    if (isnan(cNorm) || isinf(cNorm))
    

    改为

    if (std::isnan(cNorm) || std::isinf(cNorm))
    

    这应该可以解决问题。

    【讨论】:

      猜你喜欢
      • 2018-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-08
      • 1970-01-01
      • 2021-02-26
      • 2014-05-24
      • 2013-05-25
      相关资源
      最近更新 更多