{"id":18761,"date":"2021-12-09T08:27:20","date_gmt":"2021-12-09T06:27:20","guid":{"rendered":"https:\/\/www.wjst.de\/blog\/?p=18761"},"modified":"2021-12-09T08:51:53","modified_gmt":"2021-12-09T06:51:53","slug":"the-python-nightmare-how-to-install-mask_rcnn-and-detectron2","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2021\/12\/the-python-nightmare-how-to-install-mask_rcnn-and-detectron2\/","title":{"rendered":"The Python nightmare: How to install mask_rcnn and detectron2"},"content":{"rendered":"<p>Coming from R the most exciting thing with Python is the incompatibility of the different modules&#8230; <\/p>\n<p>While I can recommend the <a href=\"https:\/\/docs.anaconda.com\/anaconda\/install\/index.html\">Anaconda Navigator<\/a>, the following commands work only in the terminal.<\/p>\n<p>Thanks to <a href=\"https:\/\/github.com\/matterport\/Mask_RCNN\/issues\/2587#issuecomment-987966023\">Nouman945<\/a> for help with the <a href=\"https:\/\/github.com\/matterport\/Mask_RCNN\">original mask_rcnn instructions<\/a>.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nconda create --name matterport python=3.6.13 tensorflow==1.15.0 Keras==2.2.4 h5py==2.8.0 pip\r\nconda activate matterport\r\ngit clone https:\/\/github.com\/matterport\/Mask_RCNN.git\r\ncd .\/Mask_RCNN-master\r\npython -m pip install -r requirements.txt\r\ngit clone https:\/\/github.com\/philferriere\/cocoapi.git\r\npython -m pip install pycocotools\r\npython -m pip install git+https:\/\/github.com\/philferriere\/cocoapi.git#subdirectory=PythonAPI\r\nwget https:\/\/github.com\/matterport\/Mask_RCNN\/releases\/download\/v2.1\/mask_rcnn_balloon.h5 &gt; Mask_RCNN\/mask_rcnn_coco.h5\r\nconda deactivate\r\n<\/pre>\n<p>For detectron I follow basically <a href=\"https:\/\/detectron2.readthedocs.io\/en\/latest\/tutorials\/install.html\">detectron2.readthedocs.io<\/a><\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nconda create --name detectron2 python=3.6.13 tensorflow==1.15.0 Keras==2.2.4 h5py==2.8.0 pip\r\nconda activate detectron2\r\nconda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 -c pytorch\r\ngit clone https:\/\/github.com\/facebookresearch\/detectron2.git\r\nCC=clang CXX=clang++ ARCHFLAGS=&quot;-arch x86_64&quot; python -m pip install -e detectron2\r\nconda deactivate\r\n<\/pre>\n<p>Last but not least the installed apps:<\/p>\n<p><a href=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2021\/12\/x-2.jpg\" data-rel=\"key-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2021\/12\/x-2-620x353.jpg\" alt=\"\" width=\"620\" height=\"353\" class=\"alignnone size-medium wp-image-18767\" srcset=\"https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2021\/12\/x-2-620x353.jpg 620w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2021\/12\/x-2-878x500.jpg 878w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2021\/12\/x-2-768x438.jpg 768w, https:\/\/www.wjst.de\/blog\/wp-content\/uploads\/2021\/12\/x-2.jpg 1255w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 27.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>Coming from R the most exciting thing with Python is the incompatibility of the different modules&#8230; While I can recommend the Anaconda Navigator, the following commands work only in the terminal. Thanks to Nouman945 for help with the original mask_rcnn instructions. conda create &#8211;name matterport python=3.6.13 tensorflow==1.15.0 Keras==2.2.4 h5py==2.8.0 pip conda activate matterport git clone &hellip; <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2021\/12\/the-python-nightmare-how-to-install-mask_rcnn-and-detectron2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">The Python nightmare: How to install mask_rcnn and detectron2<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[839],"class_list":["post-18761","post","type-post","status-publish","format-standard","hentry","category-computer-software","tag-python"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/18761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=18761"}],"version-history":[{"count":7,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/18761\/revisions"}],"predecessor-version":[{"id":18770,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/18761\/revisions\/18770"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=18761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=18761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=18761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}