diff --git a/.travis.yml b/.travis.yml index 644b8dfb2363673770c2556607bad2ef32683522..a78853e15b15825354ffbc6e1ca8ffb10c5257c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ before_install: script: - paddle/scripts/travis/build.sh - paddle/scripts/travis/unittest.sh + - paddle/scripts/travis/make_install.sh notifications: email: on_success: change diff --git a/paddle/gserver/dataproviders/PyDataProvider2.cpp b/paddle/gserver/dataproviders/PyDataProvider2.cpp index f7886c4e014d77d4e908fb6aed859a33c1c0791f..8e51752dc29ee317dd268d6b7d444958e75ef88e 100644 --- a/paddle/gserver/dataproviders/PyDataProvider2.cpp +++ b/paddle/gserver/dataproviders/PyDataProvider2.cpp @@ -340,6 +340,7 @@ private: size_t additionalBatchSize = 1; if (calcBatchSize_) { + PyGuard guard; py::CallableHelper calcBatchSize(this->calcBatchSize_); calcBatchSize.setArgsSize(1); calcBatchSize.getArgs().set(0, data); @@ -513,6 +514,7 @@ public: } { if (calcBatchSize_) { // custom calc batch size. + PyGuard guard; Py_INCREF(data.back().get()); py::CallableHelper calcBatchSize(calcBatchSize_); calcBatchSize.setArgsSize(1); @@ -575,6 +577,11 @@ public: scanners[i]->finishFill(inArgs[i]); } + { + PyGuard g; + cache_->drop(&data); + } + DBG << "Reading CPU Batch Done."; if (useGpu_) { @@ -592,10 +599,6 @@ public: *batch = cpuBatch; } - { - PyGuard g; - cache_->drop(&data); - } return bsize; } }; diff --git a/paddle/scripts/submit_local.sh.in b/paddle/scripts/submit_local.sh.in index eed2d315932c599231de9edcda26abe1bb4bf672..4cf5f41f195df7655c9e77eba23baf90e21cee13 100644 --- a/paddle/scripts/submit_local.sh.in +++ b/paddle/scripts/submit_local.sh.in @@ -43,6 +43,41 @@ fi 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 <