Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
8c9a9677
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8c9a9677
编写于
11月 30, 2016
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/Paddle
into acc_image_proc
上级
9d72cab0
31e57175
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
97 addition
and
22 deletion
+97
-22
CMakeLists.txt
CMakeLists.txt
+1
-1
RELEASE.md
RELEASE.md
+69
-0
paddle/scripts/docker/Dockerfile.m4
paddle/scripts/docker/Dockerfile.m4
+1
-1
plugin/opencv/CMakeLists.txt
plugin/opencv/CMakeLists.txt
+6
-1
plugin/opencv/DataTransformer.cpp
plugin/opencv/DataTransformer.cpp
+2
-2
plugin/opencv/DataTransformer.h
plugin/opencv/DataTransformer.h
+1
-3
plugin/opencv/PyDecodejpeg.cpp
plugin/opencv/PyDecodejpeg.cpp
+17
-14
未找到文件。
CMakeLists.txt
浏览文件 @
8c9a9677
...
...
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)
project
(
paddle CXX C
)
set
(
PADDLE_MAJOR_VERSION 0
)
set
(
PADDLE_MINOR_VERSION 9
)
set
(
PADDLE_PATCH_VERSION 0
a0
)
set
(
PADDLE_PATCH_VERSION 0
)
set
(
PADDLE_VERSION
${
PADDLE_MAJOR_VERSION
}
.
${
PADDLE_MINOR_VERSION
}
.
${
PADDLE_PATCH_VERSION
}
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_SOURCE_DIR
}
/cmake"
)
...
...
RELEASE.md
0 → 100644
浏览文件 @
8c9a9677
# Release v0.9.0
## New Features:
*
New Layers
*
bilinear interpolation layer.
*
spatial pyramid-pool layer.
*
de-convolution layer.
*
maxout layer.
*
Support rectangle padding, stride, window and input for Pooling Operation.
*
Add —job=time in trainer, which can be used to print time info without compiler option -WITH_TIMER=ON.
*
Expose cost_weight/nce_layer in
`trainer_config_helpers`
*
Add FAQ, concepts, h-rnn docs.
*
Add Bidi-LSTM and DB-LSTM to quick start demo @alvations
*
Add usage track scripts.
## Improvements
*
Add Travis-CI for Mac OS X. Enable swig unittest in Travis-CI. Skip Travis-CI when only docs are changed.
*
Add code coverage tools.
*
Refine convolution layer to speedup and reduce GPU memory.
*
Speed up PyDataProvider2
*
Add ubuntu deb package build scripts.
*
Make Paddle use git-flow branching model.
*
PServer support no parameter blocks.
## Bug Fixes
*
add zlib link to py_paddle
*
add input sparse data check for sparse layer at runtime
*
Bug fix for sparse matrix multiplication
*
Fix floating-point overflow problem of tanh
*
Fix some nvcc compile options
*
Fix a bug in yield dictionary in DataProvider
*
Fix SRL hang when exit.
# Release v0.8.0beta.1
New features:
*
Mac OSX is supported by source code. #138
*
Both GPU and CPU versions of PaddlePaddle are supported.
*
Support CUDA 8.0
*
Enhance
`PyDataProvider2`
*
Add dictionary yield format.
`PyDataProvider2`
can yield a dictionary with key is data_layer's name, value is features.
*
Add
`min_pool_size`
to control memory pool in provider.
*
Add
`deb`
install package & docker image for no_avx machines.
*
Especially for cloud computing and virtual machines
*
Automatically disable
`avx`
instructions in cmake when machine's CPU don't support
`avx`
instructions.
*
Add Parallel NN api in trainer_config_helpers.
*
Add
`travis ci`
for Github
Bug fixes:
*
Several bugs in trainer_config_helpers. Also complete the unittest for trainer_config_helpers
*
Check if PaddlePaddle is installed when unittest.
*
Fix bugs in GTX series GPU
*
Fix bug in MultinomialSampler
Also more documentation was written since last release.
# Release v0.8.0beta.0
PaddlePaddle v0.8.0beta.0 release. The install package is not stable yet and it's a pre-release version.
paddle/scripts/docker/Dockerfile.m4
浏览文件 @
8c9a9677
FROM PADDLE_BASE_IMAGE
MAINTAINER PaddlePaddle Dev Team <paddle-dev@baidu.com>
COPY build.sh /root/
ENV GIT_CHECKOUT=v0.9.0
a0
ENV GIT_CHECKOUT=v0.9.0
ENV WITH_GPU=PADDLE_WITH_GPU
ENV IS_DEVEL=PADDLE_IS_DEVEL
ENV WITH_DEMO=PADDLE_WITH_DEMO
...
...
plugin/opencv/CMakeLists.txt
浏览文件 @
8c9a9677
...
...
@@ -32,8 +32,13 @@ list(APPEND DEJPEG_LINKER_LIBS ${Boost_LIBRARIES})
file
(
GLOB DEJPEG_HEADER
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"*.h"
)
file
(
GLOB DEJPEG_SOURCES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
"*.cpp"
)
set
(
CMAKE_CXX_FLAGS
"-std=c++11 -O3 -fPIC -Wno-unused-parameter"
)
set
(
BUILD_PRIVATE_FLAGS
-Wno-all
-Wno-error
-Wno-non-virtual-dtor
-Wno-delete-non-virtual-dtor
)
add_library
(
DeJpeg SHARED
${
DEJPEG_SOURCES
}
)
target_compile_options
(
DeJpeg BEFORE PRIVATE
${
BUILD_PRIVATE_FLAGS
}
)
target_link_libraries
(
DeJpeg
${
DEJPEG_LINKER_LIBS
}
)
set_target_properties
(
DeJpeg PROPERTIES PREFIX
""
)
plugin/opencv/DataTransformer.cpp
浏览文件 @
8c9a9677
...
...
@@ -50,7 +50,7 @@ DataTransformer::DataTransformer(int threadNum,
prefetchFree_
.
enqueue
(
prefetch_
[
i
]);
}
numThreads_
=
12
;
numThreads_
=
threadNum
;
syncThreadPool_
.
reset
(
new
SyncThreadPool
(
numThreads_
,
false
));
}
...
...
@@ -154,7 +154,7 @@ void DataTransformer::transform(Mat& cvImgOri, float* target) {
void
DataTransformer
::
start
(
vector
<
char
*>&
data
,
int
*
datalen
,
int
*
labels
)
{
auto
job
=
[
&
](
int
tid
,
int
numThreads
)
{
for
(
in
t
i
=
tid
;
i
<
data
.
size
();
i
+=
numThreads
)
{
for
(
size_
t
i
=
tid
;
i
<
data
.
size
();
i
+=
numThreads
)
{
DataTypePtr
ret
=
prefetchFree_
.
dequeue
();
char
*
buf
=
data
[
i
];
int
size
=
datalen
[
i
];
...
...
plugin/opencv/DataTransformer.h
浏览文件 @
8c9a9677
...
...
@@ -14,7 +14,6 @@ limitations under the License. */
#include <iostream>
#include <fstream>
// #define OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
#include <opencv2/opencv.hpp>
#include <vector>
#include <string>
...
...
@@ -22,7 +21,6 @@ limitations under the License. */
#include "paddle/utils/Thread.h"
using
namespace
std
;
using
namespace
cv
;
using
namespace
paddle
;
...
...
@@ -113,7 +111,7 @@ private:
*/
int
Rand
(
int
min
,
int
max
);
typedef
pair
<
float
*
,
int
>
DataType
;
typedef
std
::
pair
<
float
*
,
int
>
DataType
;
typedef
std
::
shared_ptr
<
DataType
>
DataTypePtr
;
std
::
vector
<
DataTypePtr
>
prefetch_
;
std
::
unique_ptr
<
SyncThreadPool
>
syncThreadPool_
;
...
...
plugin/opencv/PyDecodejpeg.cpp
浏览文件 @
8c9a9677
...
...
@@ -19,13 +19,11 @@ limitations under the License. */
#include <unistd.h>
#include <glog/logging.h>
#include <numpy/arrayobject.h>
#include <boost/python.hpp>
#include "DataTransformer.h"
using
namespace
boost
::
python
;
using
namespace
std
;
/**
* DecodeJpeg is an image processing API for interfacing Python and C++
...
...
@@ -37,7 +35,7 @@ using namespace std;
class
DecodeJpeg
{
public:
/**
* The constructor will create and nitialize an object of DataTransformer.
* The constructor will create and
i
nitialize an object of DataTransformer.
*/
DecodeJpeg
(
int
threadNum
,
int
capacity
,
...
...
@@ -56,11 +54,11 @@ public:
LOG
(
FATAL
)
<<
"Object is not a numpy array"
;
}
pyTypeCheck
(
meanValues
);
int
size
=
PyArray_SIZE
(
meanValues
);
int
size
=
PyArray_SIZE
(
reinterpret_cast
<
PyArrayObject
*>
(
meanValues
)
);
isChannelMean
=
(
size
==
channel
)
?
true
:
false
;
isEltMean
=
(
size
==
channel
*
cropSizeH
*
cropSizeW
)
?
true
:
false
;
CHECK
(
isChannelMean
!=
isEltMean
);
mean
=
(
float
*
)
PyArray_DATA
(
meanValues
);
mean
=
(
float
*
)
PyArray_DATA
(
reinterpret_cast
<
PyArrayObject
*>
(
meanValues
)
);
}
tfhandlerPtr_
=
std
::
make_shared
<
DataTransformer
>
(
threadNum
,
capacity
,
...
...
@@ -91,8 +89,9 @@ public:
char
*
src
=
boost
::
python
::
extract
<
char
*>
(
pysrc
[
t
]);
data
.
push_back
(
src
);
}
int
*
dlen
=
(
int
*
)
PyArray_DATA
(
pydlen
);
int
*
dlabels
=
(
int
*
)
PyArray_DATA
(
pylabel
);
int
*
dlen
=
(
int
*
)
PyArray_DATA
(
reinterpret_cast
<
PyArrayObject
*>
(
pydlen
));
int
*
dlabels
=
(
int
*
)
PyArray_DATA
(
reinterpret_cast
<
PyArrayObject
*>
(
pylabel
));
tfhandlerPtr_
->
start
(
data
,
dlen
,
dlabels
);
}
...
...
@@ -106,8 +105,8 @@ public:
pyWritableCheck
(
pylab
);
pyContinuousCheck
(
pytrg
);
pyContinuousCheck
(
pylab
);
float
*
data
=
(
float
*
)
PyArray_DATA
(
pytrg
);
int
*
label
=
(
int
*
)
PyArray_DATA
(
pylab
);
float
*
data
=
(
float
*
)
PyArray_DATA
(
reinterpret_cast
<
PyArrayObject
*>
(
pytrg
)
);
int
*
label
=
(
int
*
)
PyArray_DATA
(
reinterpret_cast
<
PyArrayObject
*>
(
pylab
)
);
tfhandlerPtr_
->
obtain
(
data
,
label
);
}
...
...
@@ -121,8 +120,8 @@ private:
/**
* @brief Check whether the type of PyObject is valid or not.
*/
void
pyTypeCheck
(
const
PyObject
*
o
)
{
int
typenum
=
PyArray_TYPE
(
o
);
void
pyTypeCheck
(
PyObject
*
o
)
{
int
typenum
=
PyArray_TYPE
(
reinterpret_cast
<
PyArrayObject
*>
(
o
)
);
// clang-format off
int
type
=
...
...
@@ -143,13 +142,17 @@ private:
/**
* @brief Check whether the PyObject is writable or not.
*/
void
pyWritableCheck
(
PyObject
*
o
)
{
CHECK
(
PyArray_ISWRITEABLE
(
o
));
}
void
pyWritableCheck
(
PyObject
*
o
)
{
CHECK
(
PyArray_ISWRITEABLE
(
reinterpret_cast
<
PyArrayObject
*>
(
o
)));
}
/**
* @brief Check whether the PyObject is c-contiguous or not.
*/
void
pyContinuousCheck
(
PyObject
*
o
)
{
CHECK
(
PyArray_IS_C_CONTIGUOUS
(
o
));
}
};
void
pyContinuousCheck
(
PyObject
*
o
)
{
CHECK
(
PyArray_IS_C_CONTIGUOUS
(
reinterpret_cast
<
PyArrayObject
*>
(
o
)));
}
};
// DecodeJpeg
/**
* @brief Initialize the Python interpreter and numpy.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录