diff --git a/scripts/colmap2nerf.py b/scripts/colmap2nerf.py
index c624cb567412d9f9c21f5e8163e09d6b133197fb..88ba5e67d6e261aae7d0dd26feafa63566e4c74b 100755
--- a/scripts/colmap2nerf.py
+++ b/scripts/colmap2nerf.py
@@ -396,6 +396,12 @@ if __name__ == "__main__":
 		try:
 			import detectron2
 		except ModuleNotFoundError:
+			try:
+				import torch
+			except ModuleNotFoundError:
+				print("PyTorch is not installed. For automatic masking, install PyTorch from https://pytorch.org/")
+				sys.exit(1)
+
 			input("Detectron2 is not installed. Press enter to install it.")
 			import subprocess
 			package = 'git+https://github.com/facebookresearch/detectron2.git'