Steps to install with virtualenvwrapper:
- Find the location of Python with a specific version:
$ which python
/home/USERNAME/.virtualenvs/tf/bin/python
The path to Python is a softlink. Use the following command to find where the original file is:
$ namei /home/USERNAME/.virtualenvs/tf/bin/python
f: /home/USERNAME/.virtualenvs/tf/bin/python
d /
d home
d USERNAME
d .virtualenvs
d tf
d bin
l python -> /usr/bin/python3.9
d /
d usr
d bin
- python3.9
Use the path you found /usr/bin/python3.9 to create a new virtual environment:
mkvirtualenv -p /usr/bin/python3.9
- Install required modules
pip install tensorflow tf_slim cython
- Clone Tensorflow models
git clone https://github.com/tensorflow/models.git
- Install pycocotools
sudo apt install python3.9-dev
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
- Install CUDA
Follow the tutorial from here.
- Prepare project dirs
cd models/research
cp object_detection/packages/tf2/setup.py .
python setup.py install
python object_detection/builders/model_builder_tf2_test.py