Setup
Native setup, no venv
- Create working directory
$ mkdir ~/py3_tf_ros && cd ~/py3_tf_ros
Install Python 3.5
$ sudo apt-get install python3-dev python3-yaml python3-setuptools
Install
rospkg
for Python 3
$ git clone git://github.com/ros/rospkg.git
$ cd roskpkg && sudo python3 setup.py install
- Install
catkin_pkg
for Python 3
$ git clone git://github.com/ros-infrastructure/catkin_pkg.git
$ cd catkin_pkg && sudo python3 setup.py install && cd ..
- Install
catkin
for Python 3
$ git clone git://github.com/ros/catkin.git
$ cd catkin && sudo python3 setup.py install && cd ..
Install OpenCV for Python 3
pip3 install opencv-python
Download desired TensorFlow version
Setup Nvidia Drivers, CUDA and CUDNN according to the TensorFlow version.
Install downloaded TensforFlow package
pip3 install --user --upgrade tensorflow-package.whl
Check that symbolic link
/usr/local/cuda
corresponds to the CUDA version required by TensorFlow. (if there are several CUDA versions installed in the system).Test TensorFlow
python -c "import tensorflow as tf; print(tf.__version__)"
This should display the version1.XX.YY
you selected.It is possible to
import ros
andimport tensorflow
.If
cv2
package is also required:
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
sys.path.append(`/opt/ros/kinetic/lib/python2.7/dist-packages`)
import ros