Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions paddle/scripts/submit_local.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ import setuptools
print str(packaging.version.Version("@PADDLE_VERSION@"))
' 2>/dev/null)
BASEDIR=$(dirname "$0")
pip install ${BASEDIR}/../opt/paddle/share/wheels/*-${PYTHON_PADDLE_VERSION}-*.whl
pip install ${BASEDIR}/../../opt/paddle/share/wheels/*-${PYTHON_PADDLE_VERSION}-*.whl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we all switch to install using pip install this may not be needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if [ $? -ne 0 ]; then
echo "pip install wheels failed. "
echo "Please use 'sudo paddle' at the first time you use PaddlePaddle"
Expand All @@ -112,13 +112,13 @@ fi

case "$1" in
"train")
${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2}
${DEBUGGER} $MYDIR/../../opt/paddle/bin/paddle_trainer ${@:2}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If install with pip install, the paddle script will be under /usr/local/bin/paddle but binaries are under somewhere like: /usr/lib/python2.7/site-packages/usr/opt/paddle/bin.

So the correct way is to check both where paddle installed and the python package installed, and find where the binaries are.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for your reference:
I build and installed with root, then pip install whl, and got paddle in /usr/bin and the binaries are in /usr/lib64/python2.7/site-packages/usr/local/opt/paddle/bin/.

Since paddle is installed with scripts, however other binaries are installed with data_files in setup.py.in.
I thought maybe them could be installed with the same way, then it should be much easier to find the correct binaries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @typhoonzero and @tensor-tang , I think the binary file paddle_train/paddle_pserver_main/... is placed under two different directories in the Docker image just because we installed the deb package while building production Docker image.For now we can install paddle with whl instead of deb package, I'll update this PR and please review after a moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tensor-tang , I tried to modify data_files to the absolute path /usr/local/opt/paddle, but maybe date_files will always be installed under python packages directory, here is the document from https://docs.python.org/2.7/distutils/setupscript.html#installing-additional-files:

Each file name in files is interpreted relative to the setup.py script at the top of the package source distribution.

;;
"merge_model")
${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_merge_model ${@:2}
${DEBUGGER} $MYDIR/../../opt/paddle/bin/paddle_merge_model ${@:2}
;;
"pserver")
${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_pserver_main ${@:2}
${DEBUGGER} $MYDIR/../../opt/paddle/bin/paddle_pserver_main ${@:2}
;;
"dump_config")
python -m paddle.utils.dump_config ${@:2}
Expand Down