{"id":784,"date":"2019-12-10T01:39:01","date_gmt":"2019-12-10T01:39:01","guid":{"rendered":"https:\/\/www.danielparente.net\/en\/2019\/12\/10\/how-to-install-tensorflow-2-0-on-macos\/"},"modified":"2019-12-10T01:39:01","modified_gmt":"2019-12-10T01:39:01","slug":"how-to-install-tensorflow-2-0-on-macos","status":"publish","type":"post","link":"https:\/\/www.danielparente.net\/en\/2019\/12\/10\/how-to-install-tensorflow-2-0-on-macos\/","title":{"rendered":"How to install TensorFlow 2.0 on macOS"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"\">\n<p><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_header.png\" target=\"_blank\" rel=\"noopener\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-11890\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_header.png\" alt=\"\" width=\"600\" height=\"600\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_header.png 600w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_header-300x300.png 300w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_header-150x150.png 150w\" sizes=\"(max-width: 600px) 100vw, 600px\"\/><\/a><\/p>\n<p>In this tutorial, you will learn to install TensorFlow 2.0 on your macOS system running either Catalina or Mojave<\/p>\n<p>There are a number of important updates in TensorFlow 2.0, including eager execution, automatic differentiation, and better multi-GPU\/distributed training support,\u00a0<strong>but the\u00a0<em>most important update<\/em> is that Keras is now the\u00a0<em>official<\/em> high-level deep learning API for TensorFlow.<\/strong><\/p>\n<p>Furthermore, if you own a copy of my book,\u00a0<a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\"><em>Deep Learning for Computer Vision with Python<\/em><\/a>, you should use this guide to properly install TensorFlow 2.0 on your macOS system.<\/p>\n<p>Inside this tutorial, you\u2019ll learn how to install TensorFlow 2.0 on macOS (using either Catalina or Mojave).<\/p>\n<p>Alternatively, <a href=\"https:\/\/www.pyimagesearch.com\/2019\/12\/09\/how-to-install-tensorflow-2-0-on-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\">click here for my <strong>Ubuntu + TensorFlow 2.0<\/strong> installation instructions<\/a>.<\/p>\n<p><strong>To learn how to install TensorFlow 2.0 on macOS, <em>just keep reading.<\/em><\/strong><\/p>\n<h2>How to install TensorFlow 2.0 on macOS<\/h2>\n<p>In the first part of this tutorial, we\u2019ll briefly discuss the pre-configured deep learning development environments that are a part of my book, <em><a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\">Deep Learning for Computer Vision with Python<\/a>.<\/em><\/p>\n<p>We\u2019ll then configure and install TensorFlow 2.0 on our macOS system.<\/p>\n<p>Let\u2019s begin.<\/p>\n<h3>Pre-configured deep learning environments<\/h3>\n<div id=\"attachment_11765\" style=\"width: 607px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" aria-describedby=\"caption-attachment-11765\" class=\"wp-image-11765\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2017\/09\/deep_learning_vm_header.png\" alt=\"\" width=\"597\" height=\"476\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2017\/09\/deep_learning_vm_header.png 1702w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2017\/09\/deep_learning_vm_header-300x239.png 300w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2017\/09\/deep_learning_vm_header-1024x817.png 1024w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2017\/09\/deep_learning_vm_header-768x613.png 768w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2017\/09\/deep_learning_vm_header-1536x1226.png 1536w\" sizes=\"(max-width: 597px) 100vw, 597px\"\/><\/p>\n<p id=\"caption-attachment-11765\" class=\"wp-caption-text\"><strong>Figure 1:<\/strong> My deep learning Virtual Machine with TensorFlow, Keras, OpenCV, and all other Deep Learning and Computer Vision libraries you need, pre-configured and pre-installed.<\/p>\n<\/div>\n<p>When it comes to working with deep learning and Python I <em>highly recommend<\/em> that you use a Unix-based environment.<\/p>\n<p>Deep learning tools can be more easily configured and installed on Unix systems, allowing you to develop and run neural networks quickly.<\/p>\n<p>Of course, configuring your own deep learning + Python + Linux development environment can be quite the tedious task, <em>especially<\/em> if you are new to Unix, a beginner at working the command line\/terminal, or a novice when compiling and installing packages by hand.<\/p>\n<p>In order to help you jump start your deep learning + Python education, I have created two pre-configured environments:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.pyimagesearch.com\/2017\/09\/22\/deep-learning-python-ubuntu-virtual-machine\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Pre-configured VirtualBox Ubuntu Virtual Machine (VM)<\/strong><\/a> with all necessary deep learning libraries you need to be successful (including <em>Keras<\/em>, <em>TensorFlow<\/em>, <em>scikit-learn<\/em>, <em>scikit-image<\/em>, <em>OpenCV<\/em>, and others) <strong><em>pre-configured<\/em><\/strong> and <strong><em>pre-installed<\/em><\/strong>.<\/li>\n<li><a href=\"https:\/\/www.pyimagesearch.com\/2017\/09\/20\/pre-configured-amazon-aws-deep-learning-ami-with-python\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Pre-configured Deep Learning Amazon Machine Image (AMI)<\/strong><\/a> which runs on Amazon Web Service\u2019s (AWS) Elastic Compute (EC2) infrastructure. This environment is free for anyone on the internet to use regardless of whether you are a DL4CV customer of mine or not (cloud\/GPU fees apply). Deep learning libraries are <em><strong>pre-installed<\/strong><\/em> including both those listed in #1 in addition to <em>TFOD API<\/em>, <em>Mask R-CNN<\/em>, <em>RetinaNet<\/em>, and <em>mxnet<\/em>.<\/li>\n<\/ol>\n<p>I <strong><em>strongly urge<\/em><\/strong> you to consider using my pre-configured environments if you are working through my books. Using a pre-configured environment is not cheating \u2014\u00a0 <strong>they simply allow you to focus on learning rather than the job of a system administrator.<\/strong><\/p>\n<p>If you are more familiar with Microsoft Azure\u2019s infrastructure, be sure to <a href=\"https:\/\/www.pyimagesearch.com\/2018\/03\/21\/my-review-of-microsofts-deep-learning-virtual-machine\/\" target=\"_blank\" rel=\"noopener noreferrer\">check out their Ubuntu Data Science Virtual Machine (DSVM), including my review of the environment<\/a>. The Azure team maintains a great environment for you and I cannot speak highly enough about the support they provided while I ensured that all of my deep learning chapters ran successfully on their system.<\/p>\n<p>That said, pre-configured environments are not for everyone.<\/p>\n<p>In the remainder of this tutorial, we will serve as the \u201cdeep learning systems administrators\u201d installing TensorFlow 2.0 on our bare metal macOS machine.<\/p>\n<h3>Configuring your macOS TensorFlow 2.0 deep learning system<\/h3>\n<p>The following instructions for installing TensorFlow 2.0 on your machine assume either:<\/p>\n<ul>\n<li>You have administrative access to your system<\/li>\n<li>You can open a terminal and or you have an active SSH connection to the target machine<\/li>\n<li>You know how to operate the command line.<\/li>\n<\/ul>\n<p>Let\u2019s get started!<\/p>\n<h4>Step #1: Choose your macOS deep learning platform \u2014 either Catalina or Mojave<\/h4>\n<div id=\"attachment_11879\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_mojave_catlina.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" aria-describedby=\"caption-attachment-11879\" class=\"size-full wp-image-11879\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_mojave_catlina.png\" alt=\"\" width=\"600\" height=\"379\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_mojave_catlina.png 600w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_mojave_catlina-300x190.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\"\/><\/a><\/p>\n<p id=\"caption-attachment-11879\" class=\"wp-caption-text\"><strong>Figure 3:<\/strong> This tutorial supports installing TensorFlow 2.0 on macOS Mojave or macOS Catalina.<\/p>\n<\/div>\n<p>These TensorFlow 2.0 install instructions in this guide are compatible with the following operating systems:<\/p>\n<ol>\n<li><strong>macOS:<\/strong> 10.15 \u201cCatalina\u201d<\/li>\n<li><strong> macOS:<\/strong> 10.14 \u201cMojave\u201d<\/li>\n<\/ol>\n<p>Alternatively, <a href=\"https:\/\/www.pyimagesearch.com\/2019\/12\/09\/how-to-install-tensorflow-2-0-on-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\">you may follow my Ubuntu + TensorFlow 2.0 installation instructions<\/a>.<\/p>\n<p><em><strong>Note:<\/strong> You may be wondering \u201cWhat about Windows?\u201d Keep in mind I do not support Windows on the PyImageSearch blog. <a href=\"https:\/\/www.pyimagesearch.com\/faqs\/single-faq\/can-you-help-me-do-___-on-windows\" target=\"_blank\" rel=\"noopener noreferrer\">You can read more about my \u201cno Windows policy\u201d in my FAQ<\/a>.<\/em><\/p>\n<h4>Step #2 (Catalina only): Choose Bash or ZSH as your shell<\/h4>\n<p>This step is for <strong>macOS Catalina <em>only<\/em><\/strong>. If you use Mojave, please ignore this step and skip to\u00a0<strong>Step #3<\/strong>.<\/p>\n<p>On macOS Catalina, you have the option of using a Bash shell or ZSH shell.<\/p>\n<p><strong>Bash is probably what you\u2019re used to.<\/strong> Previous versions of macOS have used Bash and by default, Ubuntu uses Bash as well. <strong>Apple has now made a decision that going forward, their operating systems will use ZSH.<\/strong><\/p>\n<p><em><strong>So what\u2019s the big deal and should I switch?<\/strong><\/em><\/p>\n<p>Describing the differences between Bash and ZSH is outside the scope of this post \u2014 it\u2019s entirely up to you to decide. I would recommend reading this <a href=\"https:\/\/stackabuse.com\/zsh-vs-bash\/\" target=\"_blank\" rel=\"noopener noreferrer\">ZSH vs. Bash tutorial<\/a> to get you started, but again, the choice is up to you.<\/p>\n<p>On one hand, you may discover that the changes do not impact you much and that using ZSH will be very comparable to Bash. Power users, on the other hand, may notice additional features.<\/p>\n<p>If you\u00a0<em>upgraded<\/em> from\u00a0High Sierra or Mojave to Catalina, by default your system will likely use Bash unless you explicitly change it by going into your terminal profile settings.<\/p>\n<p>If your computer <em>came with Catalina installed or you installed Catalina from scratch<\/em>, then your system will likely use ZSH by default.<\/p>\n<p>Either way, if you decide to need make the switch on Catalina, you can <a href=\"http:\/\/osxdaily.com\/2018\/12\/29\/use-zsh-default-terminal-mac-os-x\/\" target=\"_blank\" rel=\"noopener noreferrer\">follow these instructions to set your profile to use ZSH<\/a>.<\/p>\n<p>Changing your shell is relatively simple via your <em>\u201cTerminal Preferences\u201d &gt; \u201cProfiles\u201d &gt; \u201cShell\u201d<\/em> menu as shown in <strong>Figure 4<\/strong>:<\/p>\n<div id=\"attachment_11884\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_zsh.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-11884\" class=\"wp-image-11884\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_zsh.png\" alt=\"\" width=\"600\" height=\"427\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_zsh.png 1000w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_zsh-300x214.png 300w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_zsh-768x547.png 768w\" sizes=\"(max-width: 600px) 100vw, 600px\"\/><\/a><\/p>\n<p id=\"caption-attachment-11884\" class=\"wp-caption-text\"><strong>Figure 4:<\/strong> Changing your macOS Catalina shell to ZSH (left), a step you may wish to do before installing TensorFlow 2.0 on macOS (<strong><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_zsh.png\" target=\"_blank\" rel=\"noopener noreferrer\">click for high-res<\/a><\/strong>).<\/p>\n<\/div>\n<p><strong>The shell you use determines which terminal profile you edit later in this install guide:<\/strong><\/p>\n<ul>\n<li><strong>ZSH:<\/strong> &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d615b558469280\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.zshrc<\/span><\/span><\/span><\/li>\n<li><strong>Bash:<\/strong> &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6164584638695\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bash_profile<\/span><\/span><\/span><\/li>\n<\/ul>\n<p>ZSH will accommodate &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6166178355418\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bash_profile<\/span><\/span><\/span>\u00a0 if you source it from within &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6168692364488\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.zshrc<\/span><\/span><\/span> . Just keep in mind that not all settings will work. For example, in my &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6169008234629\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bash_profile<\/span><\/span><\/span>\u00a0, I had a custom bash prompt which showed only the current lowest level working directory (shorter) and also which branch of a Git repository I\u2019m working on (useful for software development). The problem is that ZSH didn\u2019t like my custom Bash prompt, so I had to remove it. I\u2019ll have to set up a custom ZSH prompt in the future.<\/p>\n<p>Realistically, it is probably better if you copy the settings from your Bash Profile that you need into your ZSH profile and ensure that they work. Alternatively, you can source your Bash Profile within your ZSH Profile (i.e. insert &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d616b454219925\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">source<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bash_profile<\/span><\/span><\/span>\u00a0 as a line into your &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d616c081174055\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.zshrc<\/span><\/span><\/span>\u00a0 file \u2014 then open a fresh shell or reload it with the &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d616e097345163\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">source<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.zshrc<\/span><\/span><\/span>\u00a0 command).<\/p>\n<p>If you were previously working in Bash (i.e. you upgraded to Catalina), you may encounter the following message in your terminal:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d616f645776572\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\nThe default interactive shell is now zsh.&#13;<br \/>\nTo update your account to use zsh, please run chsh -s \/bin\/zsh&#13;<br \/>\nFor more details, please visit https:\/\/support.apple.com\/kb\/HT208050.<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p>The default interactive shell is now zsh.<\/p>\n<p>To update your account to use zsh, please run chsh -s \/bin\/zsh<\/p>\n<p>For more details, please visit https:\/\/support.apple.com\/kb\/HT208050.<\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0000 seconds] -->&#13;<\/p>\n<p>This means that to switch shells, you should enter the command at the prompt:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<br \/>\n\t\t&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p><strong>Note that the ZSH prompt is &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6171912040095\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">%<\/span><\/span><\/span> . The remainder of this tutorial will show &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6173463587732\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-sy\">$<\/span><\/span><\/span> at the beginning of the prompt, but you can think of it as &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6174384666970\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">%<\/span><\/span><\/span>\u00a0 if you are using ZSH.<\/strong><\/p>\n<h4>Step #3: Install macOS deep learning dependencies<\/h4>\n<div id=\"attachment_11893\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_instal_macos_xcode.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-11893\" class=\"wp-image-11893 size-full\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_instal_macos_xcode.png\" alt=\"\" width=\"600\" height=\"699\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_instal_macos_xcode.png 600w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_instal_macos_xcode-258x300.png 258w\" sizes=\"(max-width: 600px) 100vw, 600px\"\/><\/a><\/p>\n<p id=\"caption-attachment-11893\" class=\"wp-caption-text\"><strong>Figure 5:<\/strong> Prior to installing TensorFlow 2.0 on macOS Mojave or macOS Catalina, you must install Xcode from the App Store.<\/p>\n<\/div>\n<p>In either version of macOS, go ahead and open your macOS App Store and find and <strong>download\/install Xcode <\/strong>(<strong>Figure 5<\/strong>).<\/p>\n<p>From there, accept the Xcode license in the terminal:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d6175511528045\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ sudo xcodebuild -license<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">sudo <\/span><span class=\"crayon-v\">xcodebuild<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">license<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Press the &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6177351485305\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">space<\/span><\/span><\/span>\u00a0 key as you read the agreement. Then type &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6178062522348\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">agree<\/span><\/span><\/span>\u00a0 at the prompt.<\/p>\n<p>And then install Xcode select:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d6179742310959\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ sudo xcode-select &#8211;install<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">sudo <\/span><span class=\"crayon-v\">xcode<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">select<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-v\">install<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p><strong><em>Note:<\/em><\/strong> <em>If you encounter this error message &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d617a413879908\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">xcode<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-k \">select<\/span><span class=\"crayon-o\">:<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">error<\/span><span class=\"crayon-o\">:<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-i\">tool<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-s\">&#8216;xcodebuild&#8217;<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">requires <\/span><span class=\"crayon-v\">Xcode<\/span><span class=\"crayon-sy\">,<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">but <\/span><span class=\"crayon-e\">active <\/span><span class=\"crayon-e\">developer <\/span><span class=\"crayon-i\">directory<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-s\">&#8216;\/Library\/Developer\/CommandLineTools&#8217;<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-st\">is<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-i\">a<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">command <\/span><span class=\"crayon-e\">line <\/span><span class=\"crayon-e\">tools <\/span><span class=\"crayon-v\">instance<\/span><\/span><\/span><\/em> <em>you may need to follow <a href=\"https:\/\/stackoverflow.com\/questions\/17980759\/xcode-select-active-developer-directory-error\" target=\"_blank\" rel=\"noopener noreferrer\">these SOF instructions<\/a>.<\/em><\/p>\n<div id=\"attachment_11886\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_xcode_select.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-11886\" class=\"wp-image-11886 size-full\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_xcode_select.png\" alt=\"\" width=\"600\" height=\"189\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_xcode_select.png 600w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_xcode_select-300x95.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\"\/><\/a><\/p>\n<p id=\"caption-attachment-11886\" class=\"wp-caption-text\"><strong>Figure 6:<\/strong> To install TensorFlow 2.0 on macOS Mojave\/Catalina, be sure to install the Xcode-select tools.<\/p>\n<\/div>\n<p>The unofficial, community-driven package manager for macOS is called <strong>Homebrew<\/strong> (brew for short). Many packages that you could install with Aptitude (apt) on Ubuntu are available via HomeBrew on macOS.<\/p>\n<p>We\u2019ll use Homebrew to install a handful of dependencies. It does not come pre-installed on macOS, so let\u2019s install it now (only do this if you don\u2019t already have Homebrew):<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d617c918605135\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover wrap\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ \/usr\/bin\/ruby -e &#8220;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)&#8221;<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">usr<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">ruby<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">e<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-s\">&#8220;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)&#8221;<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>From there, update Homebrew:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<br \/>\n\t\t&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Now go ahead and edit your ZSH Profile or Bash Profile. <strong>Be sure that you update the correct file depending on whether you use ZSH or Bash on macOS:<\/strong><\/p>\n<ol>\n<li>&#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d617e174811351\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">zshrc<\/span><\/span><\/span> (ZSH)<\/li>\n<li>&#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d617f159542624\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">bash_profile<\/span><\/span><\/span>\u00a0(Bash)<\/li>\n<\/ol>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d6181182386143\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ nano ~\/.zshrc # ZSH&#13;<br \/>\n$ nano ~\/.bash_profile # Bash<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">nano<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.zshrc<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-c\"># ZSH<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">nano<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bash_profile<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-c\"># Bash<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Again, you should only be editing\u00a0<em>one<\/em> of the above files based on which shell your macOS system is using.<\/p>\n<p>From there, insert the following lines at the end of your profile:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d6182358065090\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n# Homebrew&#13;<br \/>\nexport PATH=\/usr\/local\/bin:$PATH<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-c\"># Homebrew<\/span><\/p>\n<p><span class=\"crayon-e\">export <\/span><span class=\"crayon-v\">PATH<\/span><span class=\"crayon-o\">=<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">usr<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">local<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">:<\/span><span class=\"crayon-v\">$PATH<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Save the file (&#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6183426283358\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">ctrl<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">+<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">x<\/span><\/span><\/span> , &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6184055272990\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">y<\/span><\/span><\/span> , &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6186377055286\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">enter<\/span><\/span><\/span>\u00a0) and exit to your terminal.<\/p>\n<p>Now go ahead and source the profile (i.e. reload it):<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d6187546466081\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ source ~\/.zshrc # ZSH&#13;<br \/>\n$ source ~\/.bash_profile # Bash<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">source<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.zshrc<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-c\"># ZSH<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">source<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bash_profile<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-c\"># Bash<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Once again, only\u00a0<em>one<\/em> of the above commands should be executed depending on which macOS shell you are using.<\/p>\n<p>We\u2019re now ready to <strong>install Python 3:<\/strong><\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<br \/>\n\t\t&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Let\u2019s check that our Python 3 is properly linked at this point:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d6189037965555\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ which python3&#13;<br \/>\n\/usr\/local\/bin\/python3<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">which <\/span><span class=\"crayon-v\">python3<\/span><\/p>\n<p><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">usr<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">local<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">python3<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>You should verify that the output path begins with &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d618b217271937\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">usr<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">local<\/span><\/span><\/span>. If it does not, then double-check that Homebrew\u2019s Python is installed. We do not want to use the system Python as our virtual environments will be based on Homebrew\u2019s Python.<\/p>\n<p>At this point, Homebrew and Python are ready for us to <strong>install dependencies:<\/strong><\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d618c745552356\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ brew install cmake pkg-config wget&#13;<br \/>\n$ brew install jpeg libpng libtiff openexr&#13;<br \/>\n$ brew install eigen tbb hdf5<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">brew <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-e\">cmake <\/span><span class=\"crayon-v\">pkg<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-e\">config <\/span><span class=\"crayon-i\">wget<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">brew <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-e\">jpeg <\/span><span class=\"crayon-e\">libpng <\/span><span class=\"crayon-e\">libtiff <\/span><span class=\"crayon-i\">openexr<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">brew <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-e\">eigen <\/span><span class=\"crayon-e\">tbb <\/span><span class=\"crayon-v\">hdf5<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Our dependencies include compiler tools, image I\/O, optimization tools, and HDF5 for working with large datasets\/serialized files.<\/p>\n<p>Great job installing dependencies on macOS \u2014 you can now proceed to <strong>Step #4<\/strong>.<\/p>\n<h4>Step #4: Install pip and virtual environments<\/h4>\n<p>In this step, we will set up pip and Python virtual environments.<\/p>\n<p>We will use the de-facto Python package manager, pip.<\/p>\n<p><em><strong>Note:<\/strong> While you are welcome to opt for Anaconda (or alternatives), I\u2019ve still found pip to be more ubiquitous in the community. Feel free to use Anaconda if you so wish, just understand that I cannot provide support for it.<\/em><\/p>\n<p>Let\u2019s download and install pip:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d618d373661168\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ wget https:\/\/bootstrap.pypa.io\/get-pip.py&#13;<br \/>\n$ sudo python3 get-pip.py<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">wget <\/span><span class=\"crayon-v\">https<\/span><span class=\"crayon-o\">:<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bootstrap<\/span><span class=\"crayon-e\">.pypa<\/span><span class=\"crayon-e\">.io<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-r\">get<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">pip<\/span><span class=\"crayon-e\">.py<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">python3 <\/span><span class=\"crayon-r\">get<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">pip<\/span><span class=\"crayon-e\">.py<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>To complement pip, I recommend using both <a href=\"https:\/\/virtualenv.pypa.io\/en\/latest\/\" target=\"_blank\" rel=\"noopener noreferrer\">virtualenv<\/a> and <a href=\"https:\/\/virtualenvwrapper.readthedocs.io\/en\/latest\/\" target=\"_blank\" rel=\"noopener noreferrer\">virtualenvwrapper<\/a> to manage virtual environments.<\/p>\n<p>Virtual environments are a best practice when it comes to Python development. They allow you to test different versions of Python libraries in sequestered development and production environments. I use them daily and you should too for all Python development.<\/p>\n<p>In other words, do not install TensorFlow 2.0 and associated Python packages directly to your system environment. It will only cause problems later.<\/p>\n<p>Let\u2019s install my preferred virtual environment tools now:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d618e259481334\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ pip3 install virtualenv virtualenvwrapper<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip3 <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-e\">virtualenv <\/span><span class=\"crayon-v\">virtualenvwrapper<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p><em><strong>Note:<\/strong> Your system may require that you use the &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6191319421475\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">sudo<\/span><\/span><\/span>\u00a0 command to install the above virtual environment tools. This will only be required once \u2014 from here forward, do not use &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6193332935302\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">sudo<\/span><\/span><\/span>\u00a0.<\/em><\/p>\n<p>From here, we need to update our bash profile:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d6194966067037\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ nano ~\/.zshrc # ZSH&#13;<br \/>\n$ nano ~\/.bash_profile # Bash<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">nano<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.zshrc<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-c\"># ZSH<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">nano<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bash_profile<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-c\"># Bash<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Only edit\u00a0<em>one<\/em> of the files above based on which shell your macOS system uses.<\/p>\n<p>Next, enter the following lines at the bottom of the file:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d6195263463027\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n# virtualenv and virtualenvwrapper&#13;<br \/>\nexport WORKON_HOME=$HOME\/.virtualenvs&#13;<br \/>\nexport VIRTUALENVWRAPPER_PYTHON=\/usr\/local\/bin\/python3&#13;<br \/>\nsource \/usr\/local\/bin\/virtualenvwrapper.sh<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-c\"># virtualenv and virtualenvwrapper<\/span><\/p>\n<p><span class=\"crayon-e\">export <\/span><span class=\"crayon-v\">WORKON_HOME<\/span><span class=\"crayon-o\">=<\/span><span class=\"crayon-v\">$HOME<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.virtualenvs<\/span><\/p>\n<p><span class=\"crayon-e\">export <\/span><span class=\"crayon-v\">VIRTUALENVWRAPPER_PYTHON<\/span><span class=\"crayon-o\">=<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">usr<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">local<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">python3<\/span><\/p>\n<p><span class=\"crayon-v\">source<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">usr<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">local<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">virtualenvwrapper<\/span><span class=\"crayon-e\">.sh<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0002 seconds] -->&#13;<\/p>\n<p>Save the file (&#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6196061453534\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">ctrl<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">+<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">x<\/span><\/span><\/span> , &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6197912522097\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">y<\/span><\/span><\/span> , &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d6199218717428\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">enter<\/span><\/span><\/span>\u00a0) and exit to your terminal.<\/p>\n<div id=\"attachment_11887\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_profile.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-11887\" class=\"wp-image-11887\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_profile.png\" alt=\"\" width=\"600\" height=\"338\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_profile.png 725w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_profile-300x169.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\"\/><\/a><\/p>\n<p id=\"caption-attachment-11887\" class=\"wp-caption-text\"><strong>Figure 7:<\/strong> How to install TensorFlow 2.0 on macOS. This figure shows the Bash or ZSH profile in macOS configured with Homebrew and virtualenvwrapper.<\/p>\n<\/div>\n<p>Don\u2019t forget to source the changes in your profile:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d619a898622254\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ source ~\/.zshrc # ZSH&#13;<br \/>\n$ source ~\/.bash_profile # Bash<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">source<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.zshrc<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-c\"># ZSH<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">source<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bash_profile<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-c\"># Bash<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>You only need to execute\u00a0<em>one<\/em> of the commands above \u2014 just verify which shell you are using first (either ZSH or Bash).<\/p>\n<p>Output will be displayed in your terminal indicating that &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d619b395435433\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">virtualenvwrapper<\/span><\/span><\/span> is installed.<\/p>\n<p><em><strong>Note: <\/strong>If you encounter errors here, you need to address them before moving on. Usually, errors at this point are due to typos in your &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d619c618313861\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-e\">.bashrc<\/span><\/span><\/span>\u00a0 file.<\/em><\/p>\n<p>Now we\u2019re ready to create your <strong>Python 3<\/strong> deep learning <strong>virtual<\/strong> <strong>environment<\/strong> named &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d619d814987267\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">dl4cv<\/span><\/span><\/span>:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d619f854459328\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ mkvirtualenv dl4cv -p python3<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">mkvirtualenv <\/span><span class=\"crayon-v\">dl4cv<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">p<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">python3<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>You can create similar virtual environments with different names (and packages therein) as needed. On my personal system, I have many virtual environments. For developing and testing software for my book, <em><a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\">Deep Learning for Computer Vision with Python<\/a><\/em>, I like to name (or precede the name of) the environment with &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d61a0069259617\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">dl4cv<\/span><\/span><\/span> . That said, feel free to use the nomenclature that makes the most sense to you.<\/p>\n<p>Great job setting up virtual environments on your system!<\/p>\n<h4>Step #5: Install TensorFlow 2.0 into your <code>dl4cv<\/code> virtual environment on macOS<\/h4>\n<p>In this step, we\u2019ll install TensorFlow 2.0.<\/p>\n<p>A prerequisite of TensorFlow is NumPy for numerical processing. Go ahead and install NumPy and TensorFlow 2.0 using pip:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d61a1955235121\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ pip install numpy&#13;<br \/>\n$ pip install tensorflow<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-i\">numpy<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">tensorflow<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0002 seconds] -->&#13;<\/p>\n<p>Great job installing TensorFlow 2.0!<\/p>\n<h4>Step #6: Install associated packages into your <code>dl4cv<\/code> <strong>virtual environment<\/strong><\/h4>\n<div id=\"attachment_11796\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_ubuntu_libraries.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-11796\" class=\"wp-image-11796\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_ubuntu_libraries.png\" alt=\"\" width=\"600\" height=\"442\"\/><\/a><\/p>\n<p id=\"caption-attachment-11796\" class=\"wp-caption-text\"><strong>Figure 8:<\/strong> A fully-fledged TensorFlow 2.0 deep learning environment requires a handful of other Python libraries as well.<\/p>\n<\/div>\n<p>In this step, we will install additional packages needed for common deep learning development.<\/p>\n<p>We begin with standard image processing libraries including OpenCV:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d61a2632349675\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ pip install opencv-contrib-python&#13;<br \/>\n$ pip install scikit-image&#13;<br \/>\n$ pip install pillow&#13;<br \/>\n$ pip install imutils<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">opencv<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">contrib<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">python<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">scikit<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">image<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-i\">pillow<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">imutils<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0002 seconds] -->&#13;<\/p>\n<p>These image processing libraries will allow us to perform image I\/O, various preprocessing techniques, as well as graphical display.<\/p>\n<p>From there, let\u2019s install machine learning libraries and support libraries including scikit-learn and matplotlib:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d61a4291297016\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ pip install scikit-learn&#13;<br \/>\n$ pip install matplotlib&#13;<br \/>\n$ pip install progressbar2&#13;<br \/>\n$ pip install beautifulsoup4&#13;<br \/>\n$ pip install pandas<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">scikit<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">learn<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-i\">matplotlib<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-i\">progressbar2<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-i\">beautifulsoup4<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">pip <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">pandas<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0002 seconds] -->&#13;<\/p>\n<p>Great job installing associated image processing and machine learning libraries.<\/p>\n<h4>Step #7: Test your install<\/h4>\n<p>In this step, as a quick sanity test, we\u2019ll test our install.<\/p>\n<p>Fire up a Python shell in your &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d61a5909441024\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">dl4cv<\/span><\/span><\/span> environment (or whatever you named your Python virtual environment) and ensure that you can import the following packages:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d61a6170259037\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ workon dl4cv&#13;<br \/>\n$ python&#13;<br \/>\n&gt;&gt;&gt; import tensorflow as tf&#13;<br \/>\n&gt;&gt;&gt; tf.__version__&#13;<br \/>\n2.0.0&#13;<br \/>\n&gt;&gt;&gt; import tensorflow.keras&#13;<br \/>\n&gt;&gt;&gt; import cv2&#13;<br \/>\n&gt;&gt;&gt; cv2.__version__&#13;<br \/>\n4.1.2<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">workon <\/span><span class=\"crayon-i\">dl4cv<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">python<\/span><\/p>\n<p><span class=\"crayon-o\">&gt;&gt;&gt;<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">import <\/span><span class=\"crayon-e\">tensorflow <\/span><span class=\"crayon-st\">as<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">tf<\/span><\/p>\n<p><span class=\"crayon-o\">&gt;&gt;&gt;<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">tf<\/span><span class=\"crayon-e\">.__version__<\/span><\/p>\n<p><span class=\"crayon-cn\">2.0.0<\/span><\/p>\n<p><span class=\"crayon-o\">&gt;&gt;&gt;<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">import <\/span><span class=\"crayon-v\">tensorflow<\/span><span class=\"crayon-e\">.keras<\/span><\/p>\n<p><span class=\"crayon-o\">&gt;&gt;&gt;<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">import <\/span><span class=\"crayon-v\">cv2<\/span><\/p>\n<p><span class=\"crayon-o\">&gt;&gt;&gt;<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">cv2<\/span><span class=\"crayon-e\">.__version__<\/span><\/p>\n<p><span class=\"crayon-cn\">4.1.2<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0003 seconds] -->&#13;<\/p>\n<p><em><strong>Note:<\/strong> If you are on Python 3.7.3 (<strong>Catalina<\/strong>) and Clang 11.0 you could encounter <a href=\"https:\/\/github.com\/tensorflow\/tensorflow\/issues\/33183\" target=\"_blank\" rel=\"noopener noreferrer\">this error.<\/a> This is a known issue with a solution is available <a href=\"https:\/\/github.com\/tensorflow\/tensorflow\/issues\/33183#issuecomment-543931248\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/em><\/p>\n<div id=\"attachment_11888\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_test.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-11888\" class=\"wp-image-11888 size-full\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_test.png\" alt=\"\" width=\"600\" height=\"418\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_test.png 600w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2019\/12\/tensorflow2_install_macos_test-300x209.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\"\/><\/a><\/p>\n<p id=\"caption-attachment-11888\" class=\"wp-caption-text\"><strong>Figure 8:<\/strong> Testing TensorFlow 2.0 installation on macOS inside a Python interpreter.<\/p>\n<\/div>\n<h3>Accessing your TensorFlow 2.0 virtual environment<\/h3>\n<p>At this point, your TensorFlow 2.0 &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d61a7319407303\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">dl4cv<\/span><\/span><\/span>\u00a0 environment is ready to go. Whenever you would like to execute TensorFlow 2.0 code (such as from my <a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\">deep learning book<\/a>), be sure to use the &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d61a9525757845\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">workon<\/span><\/span><\/span>\u00a0 command to drop into the Python virtual environment where TensorFlow 2.0 is installed:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<br \/>\n\t\t&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p>Your ZSH or Bash prompt will be preceded with &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d61ab423562499\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-sy\">(<\/span><span class=\"crayon-v\">dl4cv<\/span><span class=\"crayon-sy\">)<\/span><\/span><\/span>\u00a0 indicating that you are \u201cinside\u201d the TensorFlow 2.0 virtual environment.<\/p>\n<p>If you need to get back to your system-level environment, you can deactivate the current virtual environment:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<br \/>\n\t\t&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<h3>Frequently Asked Questions (FAQ)<\/h3>\n<p><strong>Q: These instructions seem really complicated. Do you have a pre-configured environment?<\/strong><\/p>\n<p>A: Yes, the instructions can be daunting. I recommend brushing up on your Unix command line skills prior to following these instructions.<\/p>\n<p>That said, I do offer two <em>pre-configured environments<\/em> for my book:<\/p>\n<ol>\n<li><strong><a href=\"https:\/\/www.pyimagesearch.com\/2017\/09\/22\/deep-learning-python-ubuntu-virtual-machine\/\" target=\"_blank\" rel=\"noopener noreferrer\">Pre-configured Deep Learning Virtual Machine<\/a>:<\/strong> My VirtualBox VM is included with your purchase of <a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\">my deep learning book<\/a>. Just download the VirtualBox and import the VM into VirtualBox. From there, boot it up and you\u2019ll be running example code in a matter of minutes.<\/li>\n<li><strong><a href=\"https:\/\/www.pyimagesearch.com\/2017\/09\/20\/pre-configured-amazon-aws-deep-learning-ami-with-python\/\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Machine Image (EC2 AMI)<\/a>:<\/strong> Free for everyone on the internet. You can use this environment with no strings attached even if you don\u2019t own my deep learning book (AWS charges apply, of course). Again, compute resources on AWS are not free \u2014 you will need to pay for cloud\/GPU fees but not the AMI itself. Arguably, working on a deep learning rig in the cloud is cheaper and less time-consuming than keeping a deep learning box on-site. Free hardware upgrades, no system admin headaches, no calls to hardware vendors about warranty policies, no power bills, pay only for what you use. This is the best option if you have a few one-off projects and don\u2019t want to invest in hardware.<\/li>\n<\/ol>\n<p><strong>Q: Why didn\u2019t we install Keras?<\/strong><\/p>\n<p>A: Keras is officially part of TensorFlow as of TensorFlow v1.10.0. By installing TensorFlow 2.0 the Keras API is inherently installed.<\/p>\n<p>Keras has been deeply embedded into TensorFlow and &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d61ae298049113\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">tf<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">keras<\/span><\/span><\/span>\u00a0 is the primary high-level API in TensorFlow 2.0. The legacy functions that come with TensorFlow play nicely with &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d61af409795615\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">tf<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">keras<\/span><\/span><\/span>\u00a0 now.<\/p>\n<p>In order to understand the difference between Keras and &#13;<br \/>\n\t\t\t<span id=\"crayon-5deee677d61b0990121378\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important;font-size: 12px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\"><span class=\"crayon-v\">tf<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">keras<\/span><\/span><\/span>\u00a0 in a more detailed manner, check out my recent <a href=\"https:\/\/www.pyimagesearch.com\/2019\/10\/21\/keras-vs-tf-keras-whats-the-difference-in-tensorflow-2-0\/\" target=\"_blank\" rel=\"noopener noreferrer\">blog post<\/a>.<\/p>\n<p>You may now import Keras using the following statement in your Python programs:<\/p>\n<p><!-- Crayon Syntax Highlighter v_2.7.2_beta -->&#13;<br \/>\n&#13;<\/p>\n<div id=\"crayon-5deee677d61b1708171196\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" touchscreen minimize scroll-mouseover\" style=\" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;\">\n<p><textarea wrap=\"soft\" class=\"crayon-plain print-no\" data-settings=\"\" style=\"-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;\"><br \/>\n$ workon dl4cv&#13;<br \/>\n$ python&#13;<br \/>\n&gt;&gt;&gt; import tensorflow.keras&#13;<br \/>\n&gt;&gt;&gt;<\/textarea><\/p>\n<div class=\"crayon-main\" style=\"\">\n<table class=\"crayon-table\">\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">&#13;<br \/>\n\t\t\t\t\t&#13;\n\t\t\t\t<\/td>\n<p>&#13;<\/p>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;\">\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">workon <\/span><span class=\"crayon-i\">dl4cv<\/span><\/p>\n<p><span class=\"crayon-sy\">$<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-v\">python<\/span><\/p>\n<p><span class=\"crayon-o\">&gt;&gt;&gt;<\/span><span class=\"crayon-h\"> <\/span><span class=\"crayon-e\">import <\/span><span class=\"crayon-v\">tensorflow<\/span><span class=\"crayon-e\">.keras<\/span><\/p>\n<p><span class=\"crayon-o\">&gt;&gt;&gt;<\/span><\/p>\n<\/div>\n<\/td>\n<p>&#13;<br \/>\n\t\t\t\t\t<\/tr>\n<\/table>\n<\/div><\/div>\n<p>&#13;<br \/>\n<!-- [Format Time: 0.0001 seconds] -->&#13;<\/p>\n<p><strong>Q: Do these instructions support macOS Mojave and macOS Catalina?<\/strong><\/p>\n<p>A: Yes, these instructions have been fully tested on Mojave and Catalina. That said, Homebrew changes often and can be the source of problems. If you are having an issue, please <a href=\"https:\/\/pyimagesearch.com\/contact\" target=\"_blank\" rel=\"noopener noreferrer\">contact me<\/a> or drop a comment below. Please be respectful of this webpage and my email inbox by not dumping large amounts of terminal output. Keep in mind this <a href=\"https:\/\/www.pyimagesearch.com\/faqs\/single-faq\/can-you-help-me-setup-or-debug-my-development-environment\/\" target=\"_blank\" rel=\"noopener noreferrer\">PyImageSearch policy on debugging development environments<\/a> as well.<\/p>\n<p><strong>Q: I\u2019m really stuck. Something is not working. Can you help me?<\/strong><\/p>\n<p>A: I really love helping readers and I would love to help you configure your deep learning development environment.<\/p>\n<p>That said, I receive 100+ emails and blog post comments per day \u2014 I simply don\u2019t have the time to get to them all<\/p>\n<p>Customers of mine receive support priority over non-customers due to the number of requests myself and my team receive. Please consider becoming a customer by browsing <strong><a href=\"https:\/\/www.pyimagesearch.com\/books-and-courses\/\" target=\"_blank\" rel=\"noopener noreferrer\">my library of books and courses<\/a><\/strong>.<\/p>\n<p>My personal recommend is that you to grab a copy of <a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\"><em>Deep Learning for Computer Vision with Python<\/em><\/a> \u2014 that book includes access to my pre-configured deep learning development environments that have TensorFlow, Keras, OpenCV, etc. <em>pre-installed.\u00a0<\/em>You\u2019ll be up and running in a matter of minutes.<\/p>\n<h3>What\u2019s next?<\/h3>\n<div id=\"attachment_6954\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6954\" class=\"wp-image-6954\" src=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2018\/01\/dl4cv_trusted_by_cover.png\" alt=\"\" width=\"560\" height=\"614\" srcset=\"https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2018\/01\/dl4cv_trusted_by_cover.png 600w, https:\/\/www.pyimagesearch.com\/wp-content\/uploads\/2018\/01\/dl4cv_trusted_by_cover-274x300.png 274w\" sizes=\"(max-width: 560px) 100vw, 560px\"\/><\/a><\/p>\n<p id=\"caption-attachment-6954\" class=\"wp-caption-text\"><strong>Figure 10:<\/strong> My deep learning book, <a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\"><em>Deep Learning for Computer Vision with Python<\/em><\/a>, is trusted by employees and students of top institutions. It is regularly updated to keep pace with the fast-moving AI industry. The book is ready to go for TensorFlow 2.0.<\/p>\n<\/div>\n<p>The 3rd edition release of <strong><a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\"><em>Deep Learning for Computer Vision with Python<\/em><\/a><\/strong> (DL4CV) includes <em><strong>TensorFlow 2.0 support!<\/strong><\/em><\/p>\n<p>DL4CV has taught 1000s of PyImageSearch readers how to successfully apply Computer Vision and Deep Learning to their own projects.<\/p>\n<p>Francois Chollet, Google AI Researcher and creator of the Keras deep learning library had this to say about the book:<\/p>\n<blockquote>\n<p>This book is a great, in-depth dive into practical deep learning for computer vision. I found it to be an approachable and enjoyable read: explanations are clear and highly detailed. You\u2019ll find many practical tips and recommendations that are rarely included in other books. I highly recommend it, both to practitioners and beginners.<\/p>\n<\/blockquote>\n<p>My complete, self-study deep learning book is <strong><em>trusted by members of top machine learning schools, companies, and organizations,<\/em><\/strong> including Microsoft, Google, Stanford, MIT, CMU, and more!<\/p>\n<p>And what\u2019s more is that my readers and customers (just like you) have gone on to <a href=\"https:\/\/www.pyimagesearch.com\/2018\/03\/26\/interview-david-austin-1st-place-25000-kaggles-popular-competition\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>win Kaggle competitions<\/strong><\/a>, <a href=\"https:\/\/www.pyimagesearch.com\/2016\/03\/14\/pyimagesearch-gurus-member-spotlight-tuomo-hiippala\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>secure academic grants<\/strong><\/a>, and <a href=\"https:\/\/www.pyimagesearch.com\/2017\/06\/12\/pyimagesearch-gurus-member-spotlight-saideep-talari\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>start careers in CV and DL<\/strong><\/a> using the knowledge they gained through study and practice.<\/p>\n<p><strong>Be sure to<\/strong> <a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>take a look<\/strong><\/a> <strong>\u2014 and while you\u2019re at it, don\u2019t forget to grab your <em>(free)<\/em> table of contents + sample chapters.<\/strong><\/p>\n<h2>Summary<\/h2>\n<p>In this tutorial, you learned how to installed TensorFlow 2.0 on macOS (either on Catalina or Mojave).<\/p>\n<p>Now that your deep learning rig is configured, I would suggest picking up a copy of\u00a0<em><a href=\"https:\/\/www.pyimagesearch.com\/deep-learning-computer-vision-python-book\/\" target=\"_blank\" rel=\"noopener noreferrer\">Deep Learning for Computer Vision with Python<\/a>.<\/em> You\u2019ll be getting a great education and you\u2019ll learn how to successfully apply Deep Learning to your own projects.<\/p>\n<p><strong>To be notified when future tutorials are published here on PyImageSearch,\u00a0<em>just enter your email address in the form below!<\/em><\/strong><\/p>\n<p><!-- RightMessage WP -->\n\t<\/div>\n<p><script>\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s)}(window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n  fbq('init', '1465896023527386');\n  fbq('track', 'PageView');\n<\/script><br \/>\n<br \/>[ad_2]<br \/>\n<br \/><a href=\"https:\/\/www.pyimagesearch.com\/2019\/12\/09\/how-to-install-tensorflow-2-0-on-macos\/\" target=\"_blank\" rel=\"noopener\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] In this tutorial, you will learn to install TensorFlow 2.0 on your macOS system running either Catalina or Mojave There are a number of important updates in TensorFlow 2.0, including eager execution, automatic differentiation, and better multi-GPU\/distributed training support,\u00a0but the\u00a0most important update is that Keras is now the\u00a0official high-level deep learning API for TensorFlow. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":785,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-784","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"blocksy_meta":[],"jetpack_featured_media_url":"https:\/\/e928cfdc7rs.exactdn.com\/info\/uploads\/sites\/3\/2019\/12\/How-to-install-TensorFlow-2.0-on-macOS.png?strip=all","jetpack_shortlink":"https:\/\/wp.me\/p2TFCd-cE","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/posts\/784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/comments?post=784"}],"version-history":[{"count":0,"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/posts\/784\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/media\/785"}],"wp:attachment":[{"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/media?parent=784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/categories?post=784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.danielparente.net\/en\/wp-json\/wp\/v2\/tags?post=784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}