Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
f3b0159e
Commit
f3b0159e
authored
Jun 22, 2016
by
Fm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#pragma warning for C4503 and /bigobj
parent
63c2465f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
12 deletions
+19
-12
cmake
dlib/cmake
+6
-0
CMakeLists.txt
examples/CMakeLists.txt
+0
-11
dnn_inception_ex.cpp
examples/dnn_inception_ex.cpp
+8
-1
dnn_mnist_advanced_ex.cpp
examples/dnn_mnist_advanced_ex.cpp
+5
-0
No files found.
dlib/cmake
View file @
f3b0159e
...
...
@@ -78,6 +78,12 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
message(STATUS "Enabling SSE2 instructions")
add_definitions(-DDLIB_HAVE_SSE2)
endif()
# By default Visual Studio does not support .obj files with more than 65k sections
# Code generated by file_to_code_ex and code using DNN module can have them
# this flag enables > 65k sections, but produces .obj files that will not be readable by
# VS 2005
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()
...
...
examples/CMakeLists.txt
View file @
f3b0159e
...
...
@@ -10,10 +10,6 @@ PROJECT(examples)
include
(
../dlib/cmake
)
if
(
POLICY CMP0054
)
cmake_policy
(
SET CMP0054 NEW
)
endif
()
# Tell CMake to compile a program. We do this with the ADD_EXECUTABLE()
# statement which takes the name of the output executable and then a list of
# .cpp files to compile. Here each example consists of only one .cpp file but
...
...
@@ -35,13 +31,6 @@ ENDMACRO()
# The deep learning toolkit requires a C++11 capable compiler.
if
(
COMPILER_CAN_DO_CPP_11
)
# Visual Studio Specific
# DNN module produces long type names for NN definitions - disable this warning for MSVC
# And when compiling Debug mode file will be too big for normal compilation
if
(
MSVC OR
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"MSVC"
)
message
(
STATUS
"Enabling Visual Studio specific flags for DNN"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/wd4503 /bigobj"
)
endif
()
add_example
(
dnn_mnist_ex
)
add_example
(
dnn_mnist_advanced_ex
)
add_example
(
dnn_inception_ex
)
...
...
examples/dnn_inception_ex.cpp
View file @
f3b0159e
...
...
@@ -23,10 +23,17 @@
the IEEE Conference on Computer Vision and Pattern Recognition. 2015.
*/
// DNN module uses template-based network declaration that leads to very long
// type names. Visual Studio will produce Warning C4503 in such cases
#ifdef _MSC_VER
# pragma warning( disable: 4503 )
#endif
#include <dlib/dnn.h>
#include <iostream>
#include <dlib/data_io.h>
using
namespace
std
;
using
namespace
dlib
;
...
...
@@ -84,7 +91,7 @@ int main(int argc, char** argv) try
// Make an instance of our inception network.
net_type
net
;
cout
<<
"The net has "
<<
net
.
num_layers
<<
" layers in it."
<<
endl
;
cout
<<
net
<<
endl
;
//
cout << net << endl;
cout
<<
"Traning NN..."
<<
endl
;
...
...
examples/dnn_mnist_advanced_ex.cpp
View file @
f3b0159e
...
...
@@ -10,6 +10,11 @@
- Accessing and configuring layers in a network
*/
// DNN module uses template-based network declaration that leads to very long
// type names. Visual Studio will produce Warning C4503 in such cases
#ifdef _MSC_VER
# pragma warning( disable: 4503 )
#endif
#include <dlib/dnn.h>
#include <iostream>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment