mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
caffe-nvを使うようにした
This commit is contained in:
parent
16122a5ec7
commit
a7301a59e3
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#pragma comment(lib, "caffe-d.lib")
|
#pragma comment(lib, "caffe-nv-d.lib")
|
||||||
#pragma comment(lib, "proto-d.lib")
|
#pragma comment(lib, "proto-d.lib")
|
||||||
#pragma comment(lib, "libboost_system-vc120-mt-gd-1_59.lib")
|
#pragma comment(lib, "libboost_system-vc120-mt-gd-1_59.lib")
|
||||||
#pragma comment(lib, "libboost_thread-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")
|
#pragma comment(lib, "libboost_iostreams-vc120-mt-gd-1_59.lib")
|
||||||
#else
|
#else
|
||||||
#pragma comment(lib, "caffe.lib")
|
#pragma comment(lib, "caffe-nv.lib")
|
||||||
#pragma comment(lib, "proto.lib")
|
#pragma comment(lib, "proto.lib")
|
||||||
#pragma comment(lib, "libboost_system-vc120-mt-1_59.lib")
|
#pragma comment(lib, "libboost_system-vc120-mt-1_59.lib")
|
||||||
#pragma comment(lib, "libboost_thread-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)
|
if (ret != eWaifu2xError_OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (!caffe::UpgradeNetAsNeeded(caffemodel_path.string(), ¶m_caffemodel))
|
//if (!caffe::UpgradeNetAsNeeded(caffemodel_path.string(), ¶m_caffemodel))
|
||||||
return Waifu2x::eWaifu2xError_FailedParseModelFile;
|
// return Waifu2x::eWaifu2xError_FailedParseModelFile;
|
||||||
|
|
||||||
net = boost::shared_ptr<caffe::Net<float>>(new caffe::Net<float>(param_model));
|
net = boost::shared_ptr<caffe::Net<float>>(new caffe::Net<float>(param_model));
|
||||||
net->CopyTrainedLayersFrom(param_caffemodel);
|
net->CopyTrainedLayersFrom(param_caffemodel);
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
#define CUDNN_DLL_NAME "cudnn64_4.dll"
|
#define CUDNN_DLL_NAME "cudnn64_5.dll"
|
||||||
#define CUDNN_REQUIRE_VERION_TEXT "v4 RC"
|
#define CUDNN_REQUIRE_VERION_TEXT "v5 RC"
|
||||||
|
|
||||||
|
|
||||||
namespace caffe
|
namespace caffe
|
||||||
|
@ -59,13 +59,13 @@
|
|||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<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>
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
@ -77,7 +77,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<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>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@ -85,7 +85,7 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
@ -2237,12 +2237,12 @@ int WINAPI WinMain(HINSTANCE hInstance,
|
|||||||
ChangeWindowMessageFilter(0x0049, MSGFLT_ADD);
|
ChangeWindowMessageFilter(0x0049, MSGFLT_ADD);
|
||||||
|
|
||||||
// Caffeのエラーでないログを保存しないようにする
|
// Caffeのエラーでないログを保存しないようにする
|
||||||
google::SetLogDestination(google::INFO, "");
|
google::SetLogDestination(google::GLOG_INFO, "");
|
||||||
google::SetLogDestination(google::WARNING, "");
|
google::SetLogDestination(google::GLOG_WARNING, "");
|
||||||
|
|
||||||
// Caffeのエラーログを「error_log_~」に出力
|
// Caffeのエラーログを「error_log_~」に出力
|
||||||
google::SetLogDestination(google::ERROR, "error_log_");
|
google::SetLogDestination(google::GLOG_ERROR, "error_log_");
|
||||||
google::SetLogDestination(google::FATAL, "error_log_");
|
google::SetLogDestination(google::GLOG_FATAL, "error_log_");
|
||||||
|
|
||||||
// CDialogクラスでダイアログを作成する
|
// CDialogクラスでダイアログを作成する
|
||||||
CDialog cDialog;
|
CDialog cDialog;
|
||||||
|
@ -58,13 +58,13 @@
|
|||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<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>
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
@ -79,7 +79,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<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>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@ -87,7 +87,7 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
<Manifest>
|
||||||
|
@ -55,12 +55,12 @@ int main(int argc, char** argv)
|
|||||||
Waifu2x::init_liblary();
|
Waifu2x::init_liblary();
|
||||||
|
|
||||||
// Caffeのエラーでないログを保存しないようにする
|
// Caffeのエラーでないログを保存しないようにする
|
||||||
google::SetLogDestination(google::INFO, "");
|
google::SetLogDestination(google::GLOG_INFO, "");
|
||||||
google::SetLogDestination(google::WARNING, "");
|
google::SetLogDestination(google::GLOG_WARNING, "");
|
||||||
|
|
||||||
// Caffeのエラーログを「error_log_~」に出力
|
// Caffeのエラーログを「error_log_~」に出力
|
||||||
google::SetLogDestination(google::ERROR, "error_log_");
|
google::SetLogDestination(google::GLOG_ERROR, "error_log_");
|
||||||
google::SetLogDestination(google::FATAL, "error_log_");
|
google::SetLogDestination(google::GLOG_FATAL, "error_log_");
|
||||||
|
|
||||||
// definition of command line arguments
|
// definition of command line arguments
|
||||||
TCLAP::CmdLine cmd("waifu2x reimplementation using Caffe", ' ', "1.0.0");
|
TCLAP::CmdLine cmd("waifu2x reimplementation using Caffe", ' ', "1.0.0");
|
||||||
|
@ -58,13 +58,13 @@
|
|||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<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>
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
@ -76,7 +76,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<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>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@ -84,7 +84,7 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<DelayLoadDLLs>cudnn64_4.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
<DelayLoadDLLs>cudnn64_5.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||||
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user