Step 1
apt install python-setuptools
It fixes the problem «No module named setuptools».
Step 2
How to make Python 3 the default Python version on Ubuntu 18.04?
Step 3
pip install cython
It fixes the problem «pycocotools/_mask.c: No such file or directory».
Step 4
mkdir /usr/local/coco
cd /usr/local/coco
git clone https://github.com/cocodataset/cocoapi.git .
cd PythonAPI
make
Step 5
cp -r pycocotools <path to `tensorflow/models`>/research/