提交 0964b7ff 编写于 作者: Y Yu Yang 提交者: GitHub

Merge branch 'master' into custom_stack_trace_refines

...@@ -29,6 +29,7 @@ before_install: ...@@ -29,6 +29,7 @@ before_install:
script: script:
- paddle/scripts/travis/build.sh - paddle/scripts/travis/build.sh
- paddle/scripts/travis/unittest.sh - paddle/scripts/travis/unittest.sh
- paddle/scripts/travis/make_install.sh
notifications: notifications:
email: email:
on_success: change on_success: change
......
...@@ -340,6 +340,7 @@ private: ...@@ -340,6 +340,7 @@ private:
size_t additionalBatchSize = 1; size_t additionalBatchSize = 1;
if (calcBatchSize_) { if (calcBatchSize_) {
PyGuard guard;
py::CallableHelper calcBatchSize(this->calcBatchSize_); py::CallableHelper calcBatchSize(this->calcBatchSize_);
calcBatchSize.setArgsSize(1); calcBatchSize.setArgsSize(1);
calcBatchSize.getArgs().set(0, data); calcBatchSize.getArgs().set(0, data);
...@@ -513,6 +514,7 @@ public: ...@@ -513,6 +514,7 @@ public:
} }
{ {
if (calcBatchSize_) { // custom calc batch size. if (calcBatchSize_) { // custom calc batch size.
PyGuard guard;
Py_INCREF(data.back().get()); Py_INCREF(data.back().get());
py::CallableHelper calcBatchSize(calcBatchSize_); py::CallableHelper calcBatchSize(calcBatchSize_);
calcBatchSize.setArgsSize(1); calcBatchSize.setArgsSize(1);
...@@ -575,6 +577,11 @@ public: ...@@ -575,6 +577,11 @@ public:
scanners[i]->finishFill(inArgs[i]); scanners[i]->finishFill(inArgs[i]);
} }
{
PyGuard g;
cache_->drop(&data);
}
DBG << "Reading CPU Batch Done."; DBG << "Reading CPU Batch Done.";
if (useGpu_) { if (useGpu_) {
...@@ -592,10 +599,6 @@ public: ...@@ -592,10 +599,6 @@ public:
*batch = cpuBatch; *batch = cpuBatch;
} }
{
PyGuard g;
cache_->drop(&data);
}
return bsize; return bsize;
} }
}; };
......
...@@ -43,6 +43,41 @@ fi ...@@ -43,6 +43,41 @@ fi
export PYTHONPATH=${PWD}:${PYTHONPATH} export PYTHONPATH=${PWD}:${PYTHONPATH}
# Check python lib installed or not.
pip --help > /dev/null
if [ $? -ne 0 ]; then
echo "pip should be installed to run paddle."
exit 1
fi
INSTALLED_VERSION=`pip freeze 2>/dev/null | grep '^paddle' | sed 's/.*==//g'`
if [ -z ${INSTALLED_VERSION} ]; then
INSTALLED_VERSION="0.0.0" # not installed
fi
cat <<EOF | python -
from distutils.version import LooseVersion
import sys
if LooseVersion("${INSTALLED_VERSION}") < LooseVersion("@PADDLE_VERSION@"):
sys.exit(1)
else:
sys.exit(0)
EOF
if [ $? -eq 1 ]; then # Older version installed, or not installed at all
echo "First time run paddle, need to install some python dependencies."
BASEDIR=$(dirname "$0")
pip install ${BASEDIR}/../opt/paddle/share/wheels/*.whl
if [ $? -ne 0 ]; then
echo "pip install wheels failed. "
echo "Please use 'sudo paddle' at the first time you use PaddlePaddle"
echo "PaddlePaddle will install some python dependencies automatically."
exit 1
fi
echo "Python dependencies are installed."
fi
case "$1" in case "$1" in
"train") "train")
${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2} ${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2}
......
#!/bin/bash #!/bin/bash
cd `dirname $0` cd `dirname $0`
cd ../../../ source ./common.sh
set -e
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=OFF -DWITH_TESTING=ON -DON_TRAVIS=ON cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=OFF -DWITH_TESTING=ON -DON_TRAVIS=ON
make -j `nproc` make -j `nproc`
#!/bin/bash
set -e
mkdir -p ../../../build
cd ../../../build
#!/bin/bash
cd `dirname $0`
source ./common.sh
sudo make install
sudo paddle version
#!/bin/bash #!/bin/bash
set -e
cd `dirname $0` cd `dirname $0`
cd ../../../build source ./common.sh
env CTEST_OUTPUT_ON_FAILURE=1 make test ARGS="-j `nproc`" env CTEST_OUTPUT_ON_FAILURE=1 make test ARGS="-j `nproc`"
...@@ -22,10 +22,6 @@ find_python_module(pip REQUIRED) ...@@ -22,10 +22,6 @@ find_python_module(pip REQUIRED)
find_python_module(wheel REQUIRED) find_python_module(wheel REQUIRED)
find_python_module(google.protobuf REQUIRED) find_python_module(google.protobuf REQUIRED)
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install -f
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})")
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dist/ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dist/
DESTINATION opt/paddle/share/wheels DESTINATION opt/paddle/share/wheels
) )
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册