I have been learning Tensorflow for a few days, and have been surprised how complex and amazing the machine learning is. I having a lot of both fun and headaches training my model.
But the thing is, I can not sitting by my desk all day to watch my model get trained, Sometimes I just have to tweak a few values and restart train to see how it works out.
Then i dug my dust collecting-raspberryPI out and installed Tensorflow and Keras on it to act as a fast model-prototyping and model-evaluate machine.
Complex models can take absolutely forever to train on Raspberry Pi
And recently I bought this Khadas Vim2, then i wanted to get it to do the same thing and encountered some difficulties, So I’m going to write it down for someone who needs help and also for future reference.
Install Tensorflow
I’m Using Ubuntu VIM2_Ubuntu-xenial_Linux-4.9
Unlike RaspberryPi, I can’t install Tensorflow using pip, which says
“Could not find a version that satisfies the requirement tensorflow”
So I google it around and found this Tensorflow for Arms. And this wonderful guy actually builds wheels for several common SBCs, you can find in his Release Page
Since I had little experience in building from source, I choose to use these wheels. Luckily I found out that the Odriod-C2 is using the same CPU as Khadas Vim, both are s905. I thought it might also work on s912, so I give it a try and it actually works.
I’m using tensorflow-1.8.0-cp35-none-linux_aarch64.whl
When installing Tensorflow I got an error:“libstdc++.so.6 version ‘GLBCXX3.4.22’ not found”
Another round of Googling!
Tried
sudo apt-get install libstdc++6.
Not work
Then tried
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
take a few mins to upgrade and the error disappeared.
I tested the installation with some simple code and it seems working well.
Testing
Since I get Tensorflow on to the Vim2, I’ll give a comparison between my Computer, RaspberryP, and KhadasVim2
Running The same training script on 3 machines.
-
Computer I7-6700k Nvidia GPU GTX970 -------------------------18s
-
khadas Vim2 s912-------------------------------------------------------410s or 6min50s
-
Raspberry Pi3 BCM2837----------------------------------------------1290s or 21min30s
Above Time is just the Training time, if count the overall time(including prepare datasets, initialize GPUs, evaluating, and plotting graphs), the time will be:
Computer: 3min16s
Khadas Vim2:11min40s
Raspberry Pi:28min20s
Yes, Training model on SBCs Sucks, but I don’t want to carry a GTX970 all day with me either.
Photo for my whole SBC family.:
That’s All ,Have a nice day.