Reinforcement Learning – Starting to getting started

So far in this project no programming was needed. For the next step, which is to take a closer look on TensorFlow, a simple Notepad will not be sufficient. That is why this blog is about one of the first thing to do when it comes down to the development: choosing the right Integrated Development Environment (aka IDE), installing the best choice and getting TensorFlow running.

To be precise, this blog is about possible IDE options and  what to keep in mind when installing TensorFlow.

IDLE

Python’s integrated development and learning environment is probably the most lightweight option.

This IDE…

  • Only supports Python
  • Allows multiple working windows that are simultaneously searchable

 

Processing

Processing is an IDE which we students have already gained some experience with.

This IDE…

  • Has its own integrated programming language that does not conflict with other languages
  • Follows an arts-oriented approach to learning, teaching and making things with code

 

Eclipse

Eclipse is a popular IDE for Java development and is very customizable via plugins.

This IDE…

  • Allows for unlimited extension installations, rendering it very versatile
  • Uses cloud technology for working on multiple devices

 

 

IntelliJ IDEA

In most software development workspaces, IntelliJ seems to be a go-to choice.

This IDE…

  • Has a so-called ‘intelli-sense’, which guesses the code you want to write based on context, rendering development easier and faster.
  • Comes with many built-in tools that are very helpful for group projects, like building tools and git.

 

All of these options are completely viable and depending on the project always have some good and bad sides about them. There are more options, obviously, but I have worked with these four ones and want to keep it simple. Since I have worked with IntelliJ the most before, it is the option I am picking.

Setting up Python and TensorFlow

Installing Python is trivial – it just needs to be downloaded from its respective website and installed.  On Windows, however, there may be an extra step: Setting an environment variable that points to Python’s installation folder. Some installers include this during the installation, however, older versions definitely do not. Just in case, this process works like this:

Control Panel à System à Advanced System Settings à Environment Variables
There should be a ‘Path’ variable; one entry of it should point to Python’s installation folder.

Installing TensorFlow can be done using a single console command – if one tool is set up: pip.

pip install tensorflow

Pip is basically a tool that helps to install extensions for Python – like TensorFlow. In newer versions of Python, pip is usually included and should work out of the box. If it does not work, the ‘Path’ system variable needs to be edited (see process above).

In my case, it was not that easy. Depending on the version of Python, pip might not find a matching TensorFlow distribution. Simply put, a workaround is needed if your Python version is above 3.6. I found two solutions to this problem.

Solution 1 – this line:

python3 -m pip install –upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl

When used in a command prompt, pip will use its primitive instincts to get a compatible version depending on the given link.

Solution 2 – Uninstall Python 3.7 and install Python 3.6 instead. Worked like a charm.

To test if it worked, one can simply open python from the command line, import TensorFlow and print its version. If the version is displayed, everything worked as intended.

Sources:

https://docs.python.org/3/library/idle.html

https://py.processing.org/

https://www.eclipse.org/ide/

https://www.jetbrains.com/idea/

https://stackoverflow.com/questions/38896424/tensorflow-not-found-using-pip

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

drei × eins =