Installing Tensorflow in Anaconda on macOS

The Tensorflow website has good installation instructions for the MAC OS X environment. The official installation instructions for MacOS are provided at https://www.tensorflow.org/install/install_mac. Included are instructions for virtualenv, a native pip environment, using a Docker container, Anaconda command line, and installing from sources. Although straightforward, it doesn’t include installing in an Anaconda Navigator application environment.

Anaconda is a free, open source, community supported development environment for Python and R. Anaconda manages libraries and configurable environments. It’s also a good place to experiment with scientific and machine intelligence packages. The growingly more useful Tensorflow libraries can be used to experiment within an Anacondo environment.

Anaconda Navigator is a desktop graphical user interface included in Anaconda. Packages, environments, and channels are easy to manage with this GUI. Anaconda can be installed by following the instructions at the Anaconda download site. After installation, it’s best to make sure the latest versions are installed. To quickly update using a command line interface:

$ conda update anaconda anaconda-navigator

Then, launch the Anaconda-Navigator application.

In the Navigator application, select the Environments menu item in the far left column. By default, there is one Root environment. Multiple environments with different configurations can be set up here over time. It’s typically best to upgrade existing packages to current versions. The latest version of Python should be installed (3.6 at the time of this writing) should be used.

  1. Select the Environments menu item in the left column.
  2. Select the Environment to update (in this case Root).
  3. Select Upgradable from the drop-down menu.
  4. Select the version number in the Version column to define packages to upgrade. Make sure Python is the most recent version.
  5. Select Apply.

 

To install the Tensorflow packages, a new and clean environment can be created. It will contain the base packages necessary, the latest version of Python and Tensorflow will be installed.

  1. Select the Create button at the bottom of the Environments column.
  2. In the popup menu, type ‘Tensorflow’ in the Name text entry field.
  3. Select the Python checkbox.
  4. Select version 3.6 in the drop-down menu.
  5. Select Create.

tensorflow-environment

Tensorflow packages can now be installed into the new environment.

  1. Select ‘Not Installed’ from the drop-down menu at the top of the right window pane.
  2. Type ‘tensorflow’ in the Search Packages text input field and hit Return.
  3. Select the checkbox in the left column next to the two tensorflow package names.
  4. Click Apply.

tensorflow-install

To validate the installation, using the newly created Tensorflow environment:

  1. Make sure the Tensorflow environment is selected.
  2. Select the arrow next to the Tensorflow environment name.
  3. Select ‘Open with IPython’.
  4. A terminal window with the environment settings created will pop up.
  5. As recommended on the Tensorflow website, type the following into the terminal window
    import tensorflow as tf
    hello = tf.constant('Hello, TensorFlow!')
    sess = tf.Session()
    print(sess.run(hello))

Assuming there are no errors, the newly installed and configured environment is ready for developing with tensorflow.

Corporate Lock-in vs. Open Clouds

Lately there has been publicity about how major corporate Cloud Computing offerings are really just a play to lock you into vendor specific solutions while they collect information about you and your customers.

Richard Stallman says cloud computing is ‘stupidity’ that ultimately will result in vendor lock-in and escalating costs.

Oracle’s Larry Ellison says cloud computing is basically more of the same of what we already do. I think he is saying they will continue business as usual and jump on the band wagon and use the term.

Tim Bray blogged about cloud computing vendor lock-in being defined as  “deploying my app on Vendor X’s platform, there have to be other vendors Y and Z such that I can pull my app and its data off X and it’ll all run with minimal tweaks on either Y or Z.

Even Steve Ballmer seems to be anti cloud computing, citing that consumers don’t want it. I’m not sure I understand his argument other than essentially saying it requires some proprietary software to run in the context of someones cloud.

Tim O’Reilly wrote an excellent blog on Open Source and Cloud Computing. He provides this bit of laudable advice. “if you care about open source for the cloud, build on services that are designed to be federated rather than centralized. Architecture trumps licensing any time.”

While some of the paranoia about being lock-in and vulnerable to a corporation is warranted, there is also an undercurrent of revulsion to its marketing. This stems from the fact that the term ‘cloud computing’ has already achieved a high silliness factor in its use to brand everything (à la 2.0). Also, this computing model is not yet sorted out and should evolve into something better with input and guidance from those who are technology savvy.

A well constructed architecture for a distributed execution platform will provide a truly open and scalable solution for clouds and distributed computing in general. By Distributed Execution Platform I mean primarily a platform which can among other things:

  • dynamically discover resources on a network
  • enable dynamic software provisioning of software services where execution is most efficient
  • manage services as needs dynamically change
  • detect failures and automatically reconfigure itself to accommodate

A non-proprietary platform with these types of capabilities must be architected to execute in data centers and across individual computers connected to the internet as well as out to the edge. UIs access the remote services and data independent of where they may be running much like browsers accessing web sites. Distributed data is accessible across peers in a p2p model and accessible to all services. Data is accessed using common apis and through use of proprietary interfaces used by collections of collaborating services.

The payoff for using services executing in a open distributed execution platform will be for

  • small companies needing to exist on strict budgets,
  • individual developers looking to create the next killer application and
  • large corporations who run virtualized services (for free or fee paid) in their own data centers

The above characteristics enable large corporations and individuals to compete basically on the same playing field.

Note: I was hoping to coin the phrase ‘Distributed Execution Platform’.  But, it has been used periodically elsewhere. Most commonly at the moment by the Dryad project. Maybe it will become the next overused buzzword.

Open Source and Cloud Computing

These are some comments I have on Tim O’Reilly’s insightful post about open source and cloud computing.

There are interesting thoughts in the post about clouds becoming monolithic and how control of data by a few privileged companies will drive the development of services which access and manipulate our information.  The entry into the market of smaller organizations with new and better ideas  becomes more difficult. This is all probably true. One of the main contributing factors to this happening is that we all let it happen. Most people are not technical and are primarily concerned with an application performing some function adequately for  their needs. If it happens to be a service built and hosted by a monopoly, most people don’t care. At least not until they grow weary of the application, perceive their may be better alternatives and then want them. So the evolution of monopolies with monolithic systems arises from organizations pushing their services for profit (which is fine) and the majority of service users only being concerned with their own satisfaction. Open source and open apis and standards don’t solve this problem.

Open source does make it easier for those who are technically savvy to build new software systems and services. It doesn’t solve the issue of being able to easily publish services for wide usage. It doesn’t solve the problem of having access to network, server and storage resources which the services may need to use. If you have choices of services that represent these resources, you begin to solve the problem. If these services can be discovered dynamically rather than referenced as static locations it begins to provide an even better solution. The process becomes:

  1. I decide I want a type of service (maybe storage)
  2. I lookup what my choices might be
  3. I discover which ones are available
  4. and select one.

Standards don’t necessarily help out either. Many of the existing protocols are sufficient for communication and data transfer. Standard APIs satisfy groups of service providers that may share resources and software. But if everyone uses the same standard doesn’t it become monolithic and antiquated as it no longer provides the needs of  and access to newly emerging technologies? Having multiple standards and options is usually a better alternative. I wish I could credit the original author of this quote that has been around for at least 15 years; “The great thing about standards is that there are so many to choose from.”

So the answer to keeping monolithic organizations from squeezing out small companies’ new ideas is not through the use of open source and standards (although open source is beneficial).  The answer lies in creating a platform which executes on compute resources within the internet allowing among other things:

  • a way to look up desired services
  • identify if they have the desired capabilities
  • discover where these services maybe available
  • select the desired services for use

By services I mean, software that represents a set of capabilities implemented as

  • a software component
  • as a component in conjunction with other components or services
  • or as a software component utilizing hardware resources such as CPU, Storage, network bandwidth
  • the services are dynamically hosted where they may run most efficiently

The answer lies in allowing everyone the opportunity to create and publish services for use on a platform accessible by everyone. Think of it as a layer on top of the existing internet. It is a network overlay within which everyone has access to services. There would be a large collection to choose from with an always changing selection.  This is analogous to selection of services we choose in our everyday lives for food, auto repair, home services, etc. The answer doesn’t lie in enforcing open source and standards, the answer lies in creating an open execution platform enabling all to create and provide services.