Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
233d8976
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
提交
233d8976
编写于
5月 10, 2017
作者:
L
Liu Yiqun
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into cmake_protobuf
上级
c62357e0
4a6d2e3c
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
17 addition
and
4 deletion
+17
-4
cmake/external/python.cmake
cmake/external/python.cmake
+6
-4
python/paddle/v2/config_base.py
python/paddle/v2/config_base.py
+5
-0
python/paddle/v2/topology.py
python/paddle/v2/topology.py
+6
-0
未找到文件。
cmake/external/python.cmake
浏览文件 @
233d8976
...
@@ -16,11 +16,13 @@ INCLUDE(ExternalProject)
...
@@ -16,11 +16,13 @@ INCLUDE(ExternalProject)
INCLUDE
(
python_module
)
INCLUDE
(
python_module
)
FIND_PACKAGE
(
PythonInterp 2.7
)
FIND_PACKAGE
(
PythonInterp 2.7
)
FIND_PACKAGE
(
PythonLibs 2.7
)
IF
(
WITH_PYTHON
)
FIND_PACKAGE
(
PythonLibs 2.7
)
ENDIF
(
WITH_PYTHON
)
SET
(
py_env
""
)
SET
(
py_env
""
)
SET
(
USE_VIRTUALENV_FOR_TEST 1
)
SET
(
USE_VIRTUALENV_FOR_TEST 1
)
IF
(
PYTHON
LIBS_FOUND AND PYTHON
INTERP_FOUND
)
IF
(
PYTHONINTERP_FOUND
)
find_python_module
(
pip REQUIRED
)
find_python_module
(
pip REQUIRED
)
find_python_module
(
numpy REQUIRED
)
find_python_module
(
numpy REQUIRED
)
find_python_module
(
wheel REQUIRED
)
find_python_module
(
wheel REQUIRED
)
...
@@ -30,7 +32,7 @@ IF(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
...
@@ -30,7 +32,7 @@ IF(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
MESSAGE
(
FATAL_ERROR
"Found Python Protobuf
${
PY_GOOGLE.PROTOBUF_VERSION
}
< 3.0.0, "
MESSAGE
(
FATAL_ERROR
"Found Python Protobuf
${
PY_GOOGLE.PROTOBUF_VERSION
}
< 3.0.0, "
"please use pip to upgrade protobuf. pip install -U protobuf"
)
"please use pip to upgrade protobuf. pip install -U protobuf"
)
ENDIF
()
ENDIF
()
ELSE
(
PYTHON
LIBS_FOUND AND PYTHON
INTERP_FOUND
)
ELSE
(
PYTHONINTERP_FOUND
)
MESSAGE
(
FATAL_ERROR
"Please install python 2.7 before building PaddlePaddle."
)
MESSAGE
(
FATAL_ERROR
"Please install python 2.7 before building PaddlePaddle."
)
##################################### PYTHON ########################################
##################################### PYTHON ########################################
SET
(
PYTHON_SOURCES_DIR
${
THIRD_PARTY_PATH
}
/python
)
SET
(
PYTHON_SOURCES_DIR
${
THIRD_PARTY_PATH
}
/python
)
...
@@ -217,7 +219,7 @@ ELSE(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
...
@@ -217,7 +219,7 @@ ELSE(PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
LIST
(
APPEND external_project_dependencies python setuptools six cython wheel python-protobuf numpy
)
LIST
(
APPEND external_project_dependencies python setuptools six cython wheel python-protobuf numpy
)
ENDIF
(
PYTHON
LIBS_FOUND AND PYTHON
INTERP_FOUND
)
ENDIF
(
PYTHONINTERP_FOUND
)
IF
(
WITH_PYTHON
)
IF
(
WITH_PYTHON
)
INCLUDE_DIRECTORIES
(
${
PYTHON_INCLUDE_DIR
}
)
INCLUDE_DIRECTORIES
(
${
PYTHON_INCLUDE_DIR
}
)
...
...
python/paddle/v2/config_base.py
浏览文件 @
233d8976
...
@@ -16,6 +16,7 @@ import collections
...
@@ -16,6 +16,7 @@ import collections
import
re
import
re
from
paddle.trainer_config_helpers.default_decorators
import
wrap_name_default
from
paddle.trainer_config_helpers.default_decorators
import
wrap_name_default
import
paddle.trainer_config_helpers
as
conf_helps
import
paddle.trainer_config_helpers
as
conf_helps
from
topology
import
Topology
class
LayerType
(
type
):
class
LayerType
(
type
):
...
@@ -161,6 +162,10 @@ class Layer(object):
...
@@ -161,6 +162,10 @@ class Layer(object):
"""
"""
return
self
.
__context__
[
self
.
context_name
()].
size
return
self
.
__context__
[
self
.
context_name
()].
size
def
attr
(
self
):
topo
=
Topology
(
self
)
return
topo
.
get_layer_proto
(
self
.
name
)
def
__convert_to_v2__
(
method_name
,
def
__convert_to_v2__
(
method_name
,
parent_names
,
parent_names
,
...
...
python/paddle/v2/topology.py
浏览文件 @
233d8976
...
@@ -130,6 +130,12 @@ class Topology(object):
...
@@ -130,6 +130,12 @@ class Topology(object):
return
[(
nm
,
data_layers
[
nm
].
type
)
return
[(
nm
,
data_layers
[
nm
].
type
)
for
nm
in
self
.
proto
().
input_layer_names
]
for
nm
in
self
.
proto
().
input_layer_names
]
def
get_layer_proto
(
self
,
name
):
for
layer
in
self
.
__model_config__
.
layers
:
if
layer
.
name
==
name
:
return
layer
return
None
def
__check_layer_type__
(
layer
):
def
__check_layer_type__
(
layer
):
if
not
isinstance
(
layer
,
v2_layer
.
LayerV2
):
if
not
isinstance
(
layer
,
v2_layer
.
LayerV2
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录