As it says here, https://github.com/facebookresearch/detectron2/blob/master/INSTALL.md we need to install a few modules before installing detectron.
The only part can be difficult is to install pytorch on TX2 since TX2 is aarch64 architecture, the installation instructions on pytorch website do not work. We need to install via this page: https://devtalk.nvidia.com/default/topic/1049071/jetson-nano/pytorch-for-jetson-nano/
To upgrade pyyaml, just pip3 install pyyaml --ignore-installed
Also you might want to keep using python3 and pip3 to avoid using python2