[mlpack-svn] r17382 - mlpack/trunk/src/mlpack/core/data
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Nov 18 17:55:49 EST 2014
Author: rcurtin
Date: Tue Nov 18 17:55:49 2014
New Revision: 17382
Log:
Issue a runtime error if the user is using Armadillo 4.300.x through 4.400.x and
tries to load or save HDF5 files, since that is a bug in Armadillo.
Modified:
mlpack/trunk/src/mlpack/core/data/load_impl.hpp
Modified: mlpack/trunk/src/mlpack/core/data/load_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/data/load_impl.hpp (original)
+++ mlpack/trunk/src/mlpack/core/data/load_impl.hpp Tue Nov 18 17:55:49 2014
@@ -142,6 +142,22 @@
#ifdef ARMA_USE_HDF5
loadType = arma::hdf5_binary;
stringType = "HDF5 data";
+ #if ARMA_VERSION_MAJOR == 4 && \
+ (ARMA_VERSION_MINOR >= 300 && ARMA_VERSION_MINOR <= 400)
+ Timer::Stop("loading_data");
+ if (fatal)
+ Log::Fatal << "Attempted to load '" << filename << "' as HDF5 data, but "
+ << "Armadillo 4.300.0 through Armadillo 4.400.1 are known to have "
+ << "bugs and one of these versions is in use. Load failed."
+ << std::endl;
+ else
+ Log::Warn << "Attempted to load '" << filename << "' as HDF5 data, but "
+ << "Armadillo 4.300.0 through Armadillo 4.400.1 are known to have "
+ << "bugs and one of these versions is in use. Load failed."
+ << std::endl;
+
+ return false;
+ #endif
#else
Timer::Stop("loading_data");
if (fatal)
@@ -185,6 +201,8 @@
Log::Info << "Loading '" << filename << "' as " << stringType << ". "
<< std::flush;
+ Log::Debug << "load type " << loadType << "\n";
+
const bool success = matrix.load(stream, loadType);
if (!success)
More information about the mlpack-svn
mailing list