Project, Research

Neural Networking for Dummies 4 – Installing Python and tensorflow

I finally decided to just get a friend to scrape information from the internet for me. So while he works on that, I figure I’ll start by using some dialogue from my favorite character David Rose on the show Schitts Creek. I ended up finding some scripts online and used the lines that were identified for his character to just see what I get.

My sisters and I actually have conversations comprised of just Schitts Creek gifs and they’re honestly the best convos I have with them

So time to get back to following the original article How to Train Your Own Neural Network. The next step after getting data is to install python and install the textgenrnn files from github.

Because I don’t use github, I really didn’t know how to complete this step. I ended up installing github Desktop and making a free account to help lead me through all of this grey area. In desktop app I clicked on “Add –> Clone repository…” and then entered the github URLS to download them to my PC. (textgenrnn, keras, char-rnn, numpy, tensorflow).

Installing tensorflow is actually a lot more complicated than just using the Desktop Github app. You’ll need to follow the instructions at tensorflow’s website that I have linked and will attempt to walk through myself.

This is going to go well, I just know it

For tensorflow to work you need to have python 3.6.4 or earlier (at the time of writing this, it is not compatible with python 3.7), as well as a few other things installed and tweaked. I’m just going to do bullet style what I did for Windows 10 64-bit edition with the links to instructions explaining how to accomplish them:

Believe me, you’ll know what this is when the time comes
  • Installed virtualenv, by opening up my Command Prompt and typing in “pip install virtualenv” (without the quotes)
My girlfriend last night telling me to stop working on this and pay attention to her

I then had to set up my virtual environment and actually install tensorflow, below are the commands in the order that I typed them into my Command Prompt:

virtualenv --system-site-packages -p python ./venv
.\venv\Scripts\activate
pip install --upgrade pip
pip install tensorflow
pip install --upgrade tensorflow
python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))" 

Because I installed the Windows CPU version of tensorflow, I got the following message: Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2. After some googling on the subject, I found it supposedly impacts performance, and could possibly be corrected through customization. For now, I’m going to press on and try to get the neural network actually functioning.

We’ll deal with that problem if (when) the time comes

………..Well it seems the time has come and this is officially my problem, so I’m just going to uninstall the CPU version of tensorflow and instead install the GPU version.

pip uninstall tensorflow
pip install tensorflow-gpu
python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))" 

AND ANOTHER ERROR!!! -_- “DLL Load Failure”

So I tried:

pip install tensorflow==1.5 

And now ANOTHER ERROR “No attribute enable_eager_execution”

OKAY SO NOW I’M JUST GOING TO TRY INSTALLING IT TO MY SYSTEM AND NOT A VIRTUAL ENVIRONMENT BECAUSE THE AMOUNT I CAN’T AT THIS MOMENT IS EVEN

Are you watching Schitts Creek yet?

So I restarted Command Prompt and entered:

pip3 install --user --upgrade tensorflow
python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))" 

AND I RECEIVED THE SAME GD MESSAGE ABOUT THE AVX2 WARNING. THAT’S IT, I’M OUT

I’M OUT

Leave a Reply