{"id":148416,"date":"2023-10-20T10:49:48","date_gmt":"2023-10-20T14:49:48","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=148416"},"modified":"2024-01-31T10:00:18","modified_gmt":"2024-01-31T15:00:18","slug":"tensorflow","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/support\/research\/software-and-programming\/common-languages\/python\/python-ml\/tensorflow\/","title":{"rendered":"TensorFlow"},"content":{"rendered":"<p><a name=\"top\"><\/a><\/p>\n<div style=\"width:80%;\">\n<div style=\"float:right;width:20%;\"><img loading=\"lazy\" src=\"\/tech\/files\/2023\/12\/TF-e1702918831440.png\" alt=\"\" width=\"300\" height=\"321\" class=\"alignnone size-full wp-image-149637\" \/><\/div>\n<div style=\"float:none;\">\n<strong>Sections<\/strong><\/p>\n<ul>\n<li><a href=\"#install\">Installation<\/a><\/li>\n<ul>\n<li><a href=\"#venv\">Python Virtual Environment or Conda Env<\/a><\/li>\n<\/ul>\n<li><a href=\"#modules\">Using SCC Modules<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<p>&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<p><a name=\"install\"><\/a><\/p>\n<h2>Installation<\/h2>\n<p><u>It&#8217;s recommended that you install TensorFlow in your own Python virtual environment or conda environment<\/u>. Be mindful that the TensorFlow installation with GPU capabilities is approximately 1GB in size.<\/p>\n<p>Regardless of your use of a Python virtual environment or a conda environment, use the <code><b>pip<\/b><\/code> tool for installation. The instructions below will enable TensorFlow to run on both GPU compute nodes and CPU-only nodes.<\/p>\n<p><a name=\"venv\"><\/a> <\/p>\n<h3>Python Virtual Environment OR Conda Environment<\/h3>\n<ol>\n<li> Create and activate your <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/software-and-programming\/common-languages\/python\/python-installs\/virtualenv\/#venv\">virtualenv<\/a> or <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/software-and-programming\/common-languages\/python\/python-installs\/conda\/#using\">conda env<\/a>.<\/li>\n<li> Visit the <a href=\"https:\/\/www.tensorflow.org\/install\/pip#linux\">TensorFlow with pip<\/a> page to get the latest pip installation command for Linux.<br \/>\n<img loading=\"lazy\" src=\"\/tech\/files\/2023\/11\/tf_pip-636x241.png\" alt=\"\" class=\"alignnone wp-image-148714\" width=\"552\" height=\"209\" srcset=\"https:\/\/www.bu.edu\/tech\/files\/2023\/11\/tf_pip-636x241.png 636w, https:\/\/www.bu.edu\/tech\/files\/2023\/11\/tf_pip-768x291.png 768w, https:\/\/www.bu.edu\/tech\/files\/2023\/11\/tf_pip.png 866w\" sizes=\"(max-width: 552px) 100vw, 552px\" \/><\/li>\n<\/ol>\n<p><a name=\"modules\"><\/a><\/p>\n<h2>Using SCC Modules<\/h2>\n<p>To see the available versions of TensorFlow in the module system run:<\/p>\n<pre><code class=\"code-block\"><span class=\"prompt\">[rcs@scc1 ~]<\/span> <span class=\"command\">module avail tensorflow<\/span><\/code><\/pre>\n<p>Depending on which version you select, you will have to also load a\u00a0<code><b>python3<\/b><\/code> module or activate a conda environment. The version of Python needs to match the support provided by the module. Loading a <code><b>tensorflow<\/b><\/code> module without a <code><b>python3<\/b><\/code> module or activated conda environment will result in a message like this:<\/p>\n<pre><code class=\"code-block\"><span class=\"prompt\">[rcs@scc1 ~]<\/span> <span class=\"command\">module load tensorflow\/2.11.0<\/span>\r\n<span class=\"output\">\r\n-------------------------------------------------------------------------------\r\nWARNING: tensorflow\/2.11.0 needs to be used with Python 3.7, 3.8, 3.9 or 3.10. This can be provided by a python3 module or via a conda\r\nenvironment.\r\n\r\nFor example:\r\n\r\nmodule load python3\/3.8.10\r\nmodule load tensorflow\/2.11.0 \r\n\r\nOR:\r\n\r\nmodule load miniconda\/4.11.0\r\nconda activate INSERT_YOUR_CONDA_ENV_HERE\r\nmodule load pytorch\/1.13.1\r\n\r\n-------------------------------------------------------------------------------\r\n<\/span><\/code><\/pre>\n<p>Once an appropriate version of Python is available you can use the TensorFlow software normally from Python.<\/p>\n<p><a href=\"#top\">Back to top<\/a><\/p>\n<p><script>\r\nconst date = new Date(document.lastModified);\r\ndocument.getElementById(\"demo\").innerHTML = date;\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sections Installation Python Virtual Environment or Conda Env Using SCC Modules &nbsp; &nbsp; &nbsp; Installation It&#8217;s recommended that you install TensorFlow in your own Python virtual environment or conda environment. Be mindful that the TensorFlow installation with GPU capabilities is approximately 1GB in size. Regardless of your use of a Python virtual environment or a&#8230;<\/p>\n","protected":false},"author":1692,"featured_media":0,"parent":147628,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/148416"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/1692"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=148416"}],"version-history":[{"count":24,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/148416\/revisions"}],"predecessor-version":[{"id":150192,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/148416\/revisions\/150192"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/147628"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=148416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}