Import packages and check their version Summary Import the packages one by one and check their version. Test all the packages installed by importing them. You can build models very quickly using keras. Keras is a very beginner-friendly deep learning library. (Ignore the messages it prints about how it can be optimized for your system while importing tensorflow on the code) Keras pip install keras This installs the cpu version of tensorflow. (No, it’s not hung) TensorFlow pip install tensorflow Please be patient till it completes the installation. But this is the easiest way to get going. It may be a bit slow since we are not compiling from source on our system. Note: opencv-python is a community supported package, not officially from OpenCV. Install OpenCV for Python by typing pip install opencv-python pip install numpy h5py pillow scikit-image Let’s install some of the pre-requisite/other useful packages. Make sure the (cv) sign appears in the command line. Go into the virtual environment by typing workon cv Once it finishes installing you might want to logout and log back in. Download X11 from and install it by double clicking the downloaded file. To display image outputs from opencv or dlib, we need to install X11. This installs cmake which is needed for dlib. īefore we start pip installing Python packages, let’s take care of some of the dependencies these packages have.Ĭome out of the virtual environment by typing deactivate. You can come out of the environment by typing deactivate and enter the environment by typing workon. You can look for (cv) sign at the beginning of shell prompt. Now you are inside the virtual environment cv. The above line creates a virtual environment named cv You can create as many virtual environments you want with any name you wish. Now you are all set to create your first virtual environment. Now type source ~/.bash_profile on the terminal. In Ubuntu, Python location used to be /usr/bin/python3 # virtualenv and virtualenvwrapper export WORKON_HOME=$HOME/.virtualenvs export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3 source /usr/local/bin/virtualenvwrapper.sh vim ~/.bash_profileĪdd the following few lines and save the file. bash_profile file in your home directory, you can create one. bash_profile file before start enjoying the benefits of virtual environment. pip3 install virtualenv virtualenvwrapper Trust me, this will save you a lot of frustration in future. All the Python packages you install will be virtually contained within a particular virtual environment you create and will not mess with the things outside. Virtual environment is a super useful tool to keep things clean and separate. This should tell the version of pip and the version of Python it’s linked to. You can check whether it’s correctly linked to Python3 by typing This will install the package manager for Python3. You can check whether it’s correctly installed by typing python3 on the terminal. This will install latest version of Python for you. It will install brew and only the necessary xcode command line tools. Open up Terminal and enter the above command. So, the bottom line is you will be pretty much fine without Xcode. I was running Python scripts fine without actually installing Xcode and also Xcode is a heavy piece of software to run. But I don’t think it’s absolutely necessary. I have seen people recommending to install Xcode (an IDE for developers from Apple) as the first thing to do. But with some changes in the way we interact through commands.įor example, instead of apt-get package manager we have brew (HomeBrew) here. So, luckily we have the same terminal we are all familiar with. It turns out that macOS is also a Unix based Operating System. On Ubuntu, we all know that we can just go to the terminal and sudo apt-get install. Depending on your area of interest the list may vary. These are the basic things I work with for Computer Vision. This is not an exhaustive list by any means. Someone coming from Ubuntu background, completely new to macOS, just want to set things up for deep learning and doesn’t want to feel “I wish I didn’t pick up a MacBook”.įollowing are the basic softwares/packages you need for deep learning. Some of the process may not be the efficient / optimized way but the goal here is to get the job done with minimal efforts / frustration. I am documenting the process I followed to get things working. I decided to put together a simple setup guide to get the deep learning environment (particularly for Computer Vision) up and running on macOS the easy way. I had to look around and experiment to install all the packages I was enjoying on Ubuntu. This is from a long time Ubuntu user who recently picked up a MacBook Air for all the portability it has to offer. Setting up deep learning environment the easy way on macOS High Sierra
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |