caffe-nvを使うようにした

This commit is contained in:
lltcggie 2016-04-11 00:13:16 +09:00
parent 16122a5ec7
commit a7301a59e3
7 changed files with 26 additions and 26 deletions

View File

@ -40,7 +40,7 @@
#ifdef _MSC_VER
#ifdef _DEBUG
#pragma comment(lib, "caffe-d.lib")
#pragma comment(lib, "caffe-nv-d.lib")
#pragma comment(lib, "proto-d.lib")
#pragma comment(lib, "libboost_system-vc120-mt-gd-1_59.lib")
#pragma comment(lib, "libboost_thread-vc120-mt-gd-1_59.lib")
@ -70,7 +70,7 @@
#pragma comment(lib, "libboost_iostreams-vc120-mt-gd-1_59.lib")
#else
#pragma comment(lib, "caffe.lib")
#pragma comment(lib, "caffe-nv.lib")
#pragma comment(lib, "proto.lib")
#pragma comment(lib, "libboost_system-vc120-mt-1_59.lib")
#pragma comment(lib, "libboost_thread-vc120-mt-1_59.lib")
@ -702,8 +702,8 @@ Waifu2x::eWaifu2xError Waifu2x::ConstractNet(boost::shared_ptr<caffe::Net<float>
if (ret != eWaifu2xError_OK)
return ret;
if (!caffe::UpgradeNetAsNeeded(caffemodel_path.string(), &param_caffemodel))
return Waifu2x::eWaifu2xError_FailedParseModelFile;
//if (!caffe::UpgradeNetAsNeeded(caffemodel_path.string(), &param_caffemodel))
// return Waifu2x::eWaifu2xError_FailedParseModelFile;
net = boost::shared_ptr<caffe::Net<float>>(new caffe::Net<float>(param_model));
net->CopyTrainedLayersFrom(param_caffemodel);

View File

@ -10,8 +10,8 @@
#include <boost/optional.hpp>
#include <opencv2/opencv.hpp>
#define CUDNN_DLL_NAME "cudnn64_4.dll"
#define CUDNN_REQUIRE_VERION_TEXT "v4 RC"
#define CUDNN_DLL_NAME "cudnn64_5.dll"
#define CUDNN_REQUIRE_VERION_TEXT "v5 RC"
namespace caffe

View File

@ -59,13 +59,13 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BOOST_ALL_NO_LIB;USE_CUDNN;_SCL_SECURE_NO_WARNINGS;GFLAGS_DLL_DECLARE_FLAG=;GFLAGS_DLL_DEFINE_FLAG=;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
@ -77,7 +77,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BOOST_ALL_NO_LIB;USE_CUDNN;_SCL_SECURE_NO_WARNINGS;GFLAGS_DLL_DECLARE_FLAG=;GFLAGS_DLL_DEFINE_FLAG=;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
@ -85,7 +85,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>

View File

@ -2237,12 +2237,12 @@ int WINAPI WinMain(HINSTANCE hInstance,
ChangeWindowMessageFilter(0x0049, MSGFLT_ADD);
// Caffeのエラーでないログを保存しないようにする
google::SetLogDestination(google::INFO, "");
google::SetLogDestination(google::WARNING, "");
google::SetLogDestination(google::GLOG_INFO, "");
google::SetLogDestination(google::GLOG_WARNING, "");
// Caffeのエラーログを「error_log_」に出力
google::SetLogDestination(google::ERROR, "error_log_");
google::SetLogDestination(google::FATAL, "error_log_");
google::SetLogDestination(google::GLOG_ERROR, "error_log_");
google::SetLogDestination(google::GLOG_FATAL, "error_log_");
// CDialogクラスでダイアログを作成する
CDialog cDialog;

View File

@ -58,13 +58,13 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BOOST_ALL_NO_LIB;USE_CUDNN;_SCL_SECURE_NO_WARNINGS;GFLAGS_DLL_DECLARE_FLAG=;GFLAGS_DLL_DEFINE_FLAG=;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
@ -79,7 +79,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BOOST_ALL_NO_LIB;USE_CUDNN;_SCL_SECURE_NO_WARNINGS;GFLAGS_DLL_DECLARE_FLAG=;GFLAGS_DLL_DEFINE_FLAG=;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
@ -87,7 +87,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>

View File

@ -55,12 +55,12 @@ int main(int argc, char** argv)
Waifu2x::init_liblary();
// Caffeのエラーでないログを保存しないようにする
google::SetLogDestination(google::INFO, "");
google::SetLogDestination(google::WARNING, "");
google::SetLogDestination(google::GLOG_INFO, "");
google::SetLogDestination(google::GLOG_WARNING, "");
// Caffeのエラーログを「error_log_」に出力
google::SetLogDestination(google::ERROR, "error_log_");
google::SetLogDestination(google::FATAL, "error_log_");
google::SetLogDestination(google::GLOG_ERROR, "error_log_");
google::SetLogDestination(google::GLOG_FATAL, "error_log_");
// definition of command line arguments
TCLAP::CmdLine cmd("waifu2x reimplementation using Caffe", ' ', "1.0.0");

View File

@ -58,13 +58,13 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BOOST_ALL_NO_LIB;USE_CUDNN;_SCL_SECURE_NO_WARNINGS;GFLAGS_DLL_DECLARE_FLAG=;GFLAGS_DLL_DEFINE_FLAG=;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
@ -76,7 +76,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BOOST_ALL_NO_LIB;USE_CUDNN;_SCL_SECURE_NO_WARNINGS;GFLAGS_DLL_DECLARE_FLAG=;GFLAGS_DLL_DEFINE_FLAG=;GLOG_NO_ABBREVIATED_SEVERITIES;GOOGLE_GLOG_DLL_DECL=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
@ -84,7 +84,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>