A Tensorflow “Hello, World!”

a cute little robot waving hello

I’ve been aware of the existence of Tensorflow since around 2018. I’ve always thought “Maybe I’ll do that someday”, “Maybe I’ll train a model to recognize my handwriting” or something basic like that. I was terribly uninspired regarding ideas for AI applications.

I’m still not interested in creating an AI idea or business and taking it to market, not at least with any idea I’ve had at the time of writing. But I am interested to be able to understand and work on these systems.

I have spent most of my adult life learning to be a good software engineer, and I think it’s critical that I learn to adapt to the rapid developments in the industry. Thus begins my journey of transitioning from a programmer of systems to a programmer of systems that program systems. I’m not super comfortable with it, but I guess sometimes comfort isn’t an option.

What is Tensorflow?

I’m not 100% sure yet. Every definition I read tells me what it is, but in those definitions, I can’t really see what it does from my current level of understanding. So I’m going to give my shaky and probably somewhat incorrect definition of what I understand it to be capable of here.

I think it’s a collection of things, which is probably part of why I can’t fully comprehend everything that it is. It’s definitely a Library of different functionalities. And it seems like that library is mostly focused on creating networks in the context of ML models. I don’t want to say ‘networks of tensors’ as I’m not 100% sure that’s accurate how to describe it. I think if I were to say it in one sentence it would be:

Design, create, and maintain networks that serve as deterministic pipelines that accept data of a specific shape, and generate an output after having been trained on sets of similar data.


Installing Tensorflow

I’m going to follow this guide to get a hello, world working. And to install tensorflow to my machine (Ubuntu) I’m following this install guide.

Also, I’ll be installing Docker for this so that I can do all this in containers as recommended by the guide. I used this guide to install Docker. I’m running intel architecture on my machine, and that could be an issue. But for some reason, Docker Desktop does not want to play nicely with this machine, so Docker engine it is. CLI tooling only I guess for me!

Setting up your dev environment properly is very important and is worth the time to ensure it’s done correctly. I’m going to take my time and ensure I pick a way that is regarded to be robust and ‘just works’ because troubleshooting environments when I’m trying to get ideas working irks me.


It looks like I might be learning a lot about Docker

Check out this link if you want to learn more about my installation process. IT wasn’t terrible but it was a touch more than I thought it would be. So if you don’t already have Docker installed and you’re running an Ubuntu machine it might be worth looking at.


Hello, Jupyter Notebooks!

I’ve used cloud-based versions of these in the past a few times. But I’m running it locally now via the docker container. The notebook itself is where I will get my first chance to interface with tensorflow.

So even though I have seen some Tensorflow logs in the CLI, I feel the best format for the hello, world in this case is going to be in the Jupyter notebook.

Hello world in Jupyter notebook where I get the tensorflow verison.

Ok! That’s pretty much it. This is good enough for me for now, I can see that i have access to all the tools I need in the env to start doing stuff with Tensorflow so I’ll call this a “Mission Accomplished!”.

Conclusion

For tensorflow, docker, and jupyter notebooks newbs like myself, this setup process was potentially about 1.5 hours of work with distractions. The installation instructions are all really clear and outside of a few workarounds which I’ve documented, all went pretty swimmingly.

In the next post, I’m planning to cover more steps from the 'tensorflow quick start for beginners‘ until I see a model doing things. I am in a position where I don’t know what questions to ask so I need to go bump around into things I don’t understand so I can begin to form that web of knowledge.

Previous
Previous

Understanding the Tensorflow Quickstart

Next
Next

My Docker Installation Experience