{"id":409,"date":"2020-12-04T12:11:46","date_gmt":"2020-12-04T12:11:46","guid":{"rendered":"http:\/\/www.creatis.insa-lyon.fr\/~grenier\/?p=409"},"modified":"2024-11-04T15:15:37","modified_gmt":"2024-11-04T14:15:37","slug":"introduction-to-mlp-and-cnn-with-tf1-and-tf2","status":"publish","type":"post","link":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/?p=409","title":{"rendered":"Install Tensorflow2 or PyTorch\/MONAI-dev with conda"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><strong>Create a TensorFlow conda environment<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>If not already installed, download and install <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.conda.io\/projects\/conda\/en\/latest\/user-guide\/install\/index.html\" target=\"_blank\">conda<\/a> (anaconda)<\/li>\n\n\n\n<li>If not done, finalize conda installation and configuration (adjust the string of PATH_TO_CONDA)\n<ol class=\"wp-block-list\">\n<li><code>$ source PATH_TO_CONDA\/anaconda3\/bin\/activate<\/code><\/li>\n\n\n\n<li><code>$ conda init<\/code> <\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>Download <a href=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/teaching\/DIP\/TF2.16-cuda.yml\">TF2.16-cuda.yml<\/a><\/li>\n\n\n\n<li>Create the conda environment with the yml file you want (this example will create it in \/tmp)\n<ol class=\"wp-block-list\">\n<li>$ <code>conda env create --prefix \/tmp\/${USER}\/conda_TF2.16-cuda -f TF2.16-cuda.yml<\/code><\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>Activate the environment $ <code>conda activate \/tmp\/${USER}\/conda_TF2.16-cuda<\/code><\/li>\n\n\n\n<li>You can now enjoy your virtual environment ! For windows, remove the cupti package. If you have not a GPU (or not a nvidia one) remove lines cudnn and cudatoolkit<\/li>\n\n\n\n<li>When you want to stop an environment, you can deactivate it and restore the initial one (base) with : <code>$ conda deactivate<\/code><\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">A short summary of conda utilization:<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default wp-duotone-default-filter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"326\" src=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/Conda_exemple-1024x326.png\" alt=\"\" class=\"wp-image-458\" srcset=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/Conda_exemple-1024x326.png 1024w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/Conda_exemple-300x96.png 300w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/Conda_exemple-768x245.png 768w, https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/Conda_exemple.png 1164w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">This procedure is the same for PyTorch, just download <a href=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/teaching\/DIP\/monai-dev.yml\">monai-dev.yml<\/a> and adapt the previous lines. This file includes MONAI-dev prerequisits.<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>$ conda env create --prefix \/tmp\/${USER}\/monai-dev -f <code><code>monai-dev.yml<\/code><\/code><\/code><\/pre>\n\n\n\n<p>then finalize the MONAI-dev installation by first activate your env and then installing the MOANI-dev using (<a href=\"https:\/\/docs.monai.io\/en\/latest\/installation.html#installing-the-recommended-dependencies\">more information here<\/a>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ conda activate \/tmp\/${USER}\/monai-dev<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>$ pip install --no-build-isolation git+https:\/\/github.com\/Project-MONAI\/MONAI#egg=monai<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create a TensorFlow conda environment A short summary of conda utilization: This procedure is the same for PyTorch, just download monai-dev.yml and adapt the previous lines. This file includes MONAI-dev prerequisits. then finalize the MONAI-dev installation by first activate your env and then installing the MOANI-dev using (more information here):<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"templates\/template-full-width.php","format":"standard","meta":{"footnotes":""},"categories":[5,18,6,4],"tags":[],"class_list":["post-409","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-deep-learning-teaching","category-image-processing","category-teaching"],"_links":{"self":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=409"}],"version-history":[{"count":19,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/409\/revisions"}],"predecessor-version":[{"id":1366,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/409\/revisions\/1366"}],"wp:attachment":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}