#HowTo – Grant permissions to a folder after #Git clone, to perform #dotnet restore on a #RaspberryPi #dotnetcore

Buy Me A Coffee

Hi !

Quick post today, to leave this as a public note. And, disclaimer, I’m not a Linux expert, just a normal user; I’m sure there are plenty of better ways to do this. Any advice will be appreciated.

Context: I’m working with Git and .Net Core 3.1. Just cloned a repository and ready to run my 2 favourite commands

dotnet restore
dotnet run

However, I found this error

raspberry pi dotnet restore access denied error
/home/pi/dotnet/sdk/3.1.100/NuGet.targets(123,5): error : Access to the path '/<path>.csproj.nuget.dgspec.json' is denied. [/<path>..csproj] 
/home/pi/dotnet/sdk/3.1.100/NuGet.targets(123,5): error :   Permission denied

I’m running dotnet under the user pi, and I haven’t found a way to automatically grant permissions to new folders for this user. So everytime I clone a repo I need to grant permissions with the command.

# sudo chmod -R 757 '<path>'
sudo chmod -R 757 '/home/pi/srcebgit/testsGit/20191227MLNet/myMLApp/consumeModelApp'

And now, it’s working

raspberry pi dotnet restore working after grant user permissions

Of course, I still need to deal with other permissions issues because this project has some copy files actions on the build. Now I know the way!

raspberry pi dotnet restore working error on run

Happy coding!

Greetings @ Burlington

El Bruno

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#MachineLearning – Let's start 2020 with a free Ebook: Pattern Recognition and Machine Learning

Buy Me A Coffee
pattern recognition and machine learning christopher bishop

Hi !

I’ve posted this one some time ago, however it’s still a free and VERY USEFUL one !

Christopher Bishop, Technical Fellow and Laboratory Director In Microsoft Research Cambridge, UK, gives us the chance to download for free his eBook about Pattern Recognition and Machine Learning. With more than 700 pages of a highly recommended reading

Pattern Recognition and Machine Learning

This leading textbook provides a comprehensive introduction to the fields of pattern recognition and machine learning. It is aimed at advanced undergraduates or first-year PhD students, as well as researchers and practitioners. No previous knowledge of pattern recognition or machine learning concepts is assumed. This is the first machine learning textbook to include a comprehensive coverage of recent developments such as probabilistic graphical models and deterministic inference methods, and to emphasize a modern Bayesian perspective. It is suitable for courses on machine learning, statistics, computer science, signal processing, computer vision, data mining, and bioinformatics. This hard cover book has 738 pages in full colour, and there are 431 graded exercises (with solutions available below). Extensive support is provided for course instructors.

Download: https://www.microsoft.com/en-us/research/publication/pattern-recognition-machine-learning/

Happy Coding !

Greetings @ Toronto

El Bruno

#RaspberryPi – Microsoft Teams in RPi 4? Mmm, not yet, but it’s an interesting learning journey to start the New Year 2020

Buy Me A Coffee

Hi!

A couple of weeks ago, Microsoft released a preview version of Microsoft Teams for Linux (see references). Since that day, I was hoping to have a chance to play around with this version, mostly in a Raspberry Pi.

Those days I also had this conversation with my best half (who is a very smart person):

  • Why do you need to do this? You already have a very powerful MacBook, an amazing Dell laptop and a gaming PC. So, why do you need to install Microsoft Teams in a not so powerful device at home?
  • Because …

There is no logic answer for this, however I learned a lot in the process. Let me share, because it all start with the official download page for Microsoft Teams.

Microsoft Teams Versions

raspberry pi 4 download microsoft teams

Besides the official download page for Microsoft Teams, there is an interesting page which describes all the possible client scenarios for Desktop, Web, and Mobile. And for Desktop it includes, Windows, Linux and Mac: Get clients for Microsoft Teams (see references).

In the Linux section, we have the option to review the packages DEB and RPM repositories

This is also interesting, because browsing the repositories, you may find the Release and the Insiders versions.

Microsoft package repository with release and insider version of MS Teams

Raspberry Pi 4 64-bits kernel

The Raspberry Pi 4 has a 64 bits kernel, however the current Raspbian distro are not using the 64-bit kernel capabilities of the device. There is an entry on the RaspberryPi forums which explains how to enable the 64-bit kernel: Pi4 64-bit Raspbian kernel for testing – Focus on Pi4 (see references)

Add to config.txt

arm_64bit=1

and Run

sudo rpi-update

And done, in a NON OFFICIAL or NON SUPPORTED way, my device is running on X64.

This process took some time, at least 10 minutes.

Note: I’m 99% sure that this is not supported. So, all of this is mostly a testing and learning experience.

Add AMD64 architecture to Raspberry Pi.

Back to Microsoft Teams. After checking the available versions, I realized that AMD64 is the only supported architecture in Linux. The Raspberry Pi uses an ARM CPU, which uses the ARM instruction set. That is a different instruction set than that used by i386 and x86-64/amd64. So, there is no way to install an AMD64 package on a Raspberry Pi 4

However, I found an interesting command: dpkg –add-architecture

And I started to read about the command (some links in references).

dpkg –add-architecture is meant for CPUs that support multiple instruction sets. I think it was mainly introduced for x86-64 (i.e. 64bit) CPUs, which also support i386 (i.e. 32bit) instructions. This allows you to install packages compiled for i386 on a system that otherwise uses x86-64 packages.

So, even if it won’t work, I tried to add AMD64 in my RPi 4 with the following command:

#sudo dpkg --add-architecture {architecture name} && sudo apt-get update
sudo dpkg --add-architecture amd64 && sudo apt-get update
raspberry pi 4 lscpu

So, after this, I have the AMD64 architecture instructions installed. They are not going to work, but I can install an AMD64 package now.

Installing Teams

If you are running your Raspberry Pi with a desktop interface, just double clicking on the file: teams_1.2.00.32451_amd64.deb. This will start the installation. And, of course, it will fail!

raspberry pi 4 install microsoft teams.png

So, it was time to read and learn, and I found an alternative and amazing tool to install DEB files: GDebi (see references)

Gdebi is a tiny little app that helps you install deb files more effectively by handling dependencies. Learn how to use Gdebi and make it the default application for installing deb packages.

It’s very easy to install, just 2 commands

sudo apt-get install gdebi-core
sudo apt-get install gdebi

Note: It should work with the 2nd command, however, I needed to add the core option 1st.

raspberry pi 4 open gdebi.png

Now I got GDebi, and I can open the package with the tool, and I got a dependency problem with the libasound2 library.

raspberry pi 4 gdebi error on dependencies libasound2

Even so, I can start the installation with the command

sudo gdebi teams_1.2.00.32451_amd64.deb

and, the app won’t work, but I’ll see the shortcut access in the [Sound & Video] folder

Again, the app won’t launch, but in the personal side, I spend some good time here learning a lot about Linux, processor architectures and more. So, I’m 100% cool now!

Happy coding and Happy New Year!

Greetings @ Burlington

El Bruno

References

My Posts

My posts on Raspberry Pi

Dev posts for Raspberry Pi
Tools and Apps for Raspberry Pi
Setup the device
Hardware

#Coding4Fun – Slap your boss away with #Skype and #LeapMotion (I'm getting ready for 2020!)

Buy Me A Coffee

Important: This repost is just to start one of my 2020 projects, which is very easy: write more fun stuff !

Hi !

During all my time working I was lucky enough to have some very cool bosses. So this is not personal at all, is just a funny way to discard a “incoming call” from someone.

The main idea is to use Leap Motion SDK and Skype for Business Desktop SDK (Lync 2013 SDK) to create a simple app which will allows us to ignore a call just doing a Swipe gesture.

image

Important: If you try to use Lync 2013 SDK in Windows 10 with Visual Studio 2015 or Visual Studio 15 Preview, you’ll find tons of problems. I’ll write a post on this later about the necessary steps to do this.

The source code is available in GitHub

Greetings @ Toronto

-El Bruno

References

#Event – Resources used during the #MachineLearning Galore at @MississaugaNetU

Hi!

It was a placer to share some amazing time with the Mississauga .Net User Group last night in my last session of the decade. It was a full night focused on Artificial Intelligence and Machine Learning, and as usual is time to share the resources used in the session.

Slides

Source Code

https://github.com/elbruno/events/tree/master/2019%2009%2005%20Global%20AI%20Night

Resources

Event information

Happy Coding!

Greetings @ Burlington

El Bruno

#Training – Elements of AI, a free #ArtificialIntelligence training from Finland (with also an amazing story)

Buy Me A Coffee

Hi!

Via “The Verge” (see references), I found this amazing story.

Last year, Finland launched a free online crash course in artificial intelligence with the aim of educating its citizens about the new technology. Now, as a Christmas present to the world, the European nation is making the six week program available for anyone to take.

Finland is making its online AI crash course free to the world , The Verge

Please read the article, is an amazing initiative from a country with amazing people. They are also in the process of translate the course to all the supported languages in EU, so this will be great.

And, I decided to give the course a try and this is my thoughts, after completed Chapter 1

There are no videos here, it’s all about reading about Definitions of AI, Applications of AI, introduction to Machine Learning, and other topics.

  • I read this very fast, and boom 1st exercise I got an amazing score.
  • I keep the same pace, and then next exercises make me realize that I need to spend more time here. I won’t complete the full course in 5 minutes, I like a challenge of read, understand and explain.
  • The final test is a written one, where you need to submit your answers and there is a committee analyzing and deciding your result.

So, I’m here waiting for the response and looking forward for next chapter which may involve some Python programming.

And, as a general-purpose course I think is an amazing resource. There are so many AI courses, which most of the time are so focus on the technical part, and is nice to find a different approach to educate about Artificial Intelligence to the general public.

Greetings @ Toronto

El Bruno

References

#VS2019 – Let’s do some image classification with #MLNET Model Builder! (AKA, let’s create an image classifier model without a line of code)

Buy Me A Coffee

Hi!

I’m getting ready for my last event of the year, and I just realize that in the latest update of Model Builder, we have the chance to build our own Image Classifier scenario. Let’s start with the official Model Builder definition (see references):

ML.NET Model Builder provides an easy to understand visual interface to build, train, and deploy custom machine learning models. Prior machine learning expertise is not required. Model Builder supports AutoML, which automatically explores different machine learning algorithms and settings to help you find the one that best suits your scenario.

Working with images was supported for a while in Machine Learning.Net. In the Machine Learning .Net Samples, we have sample scenarios like

Image Classification Model Training – Preferred API (Based on native TensorFlow transfer learning)

In this sample app you create your own custom image classifier model by natively training a TensorFlow model from ML.NET API with your own images.

We even have an amazing tutorial, to create our own image classification model from zero

Tutorial: Generate an ML.NET image classification model from a pre-trained TensorFlow model

Learn how to transfer the knowledge from an existing TensorFlow model into a new ML.NET image classification model. The TensorFlow model was trained to classify images into a thousand categories. The ML.NET model makes use of part of the TensorFlow model in its pipeline to train a model to classify images into 3 categories.

Training an Image Classification model from scratch requires setting millions of parameters, a ton of labeled training data and a vast amount of compute resources (hundreds of GPU hours). While not as effective as training a custom model from scratch, transfer learning allows you to shortcut this process by working with thousands of images vs. millions of labeled images and build a customized model fairly quickly (within an hour on a machine without a GPU). This tutorial scales that process down even further, using only a dozen training images.

And now, I found that Model Builder, also supports an Image Classification Scenario.

It follows the Model Builder standard workflow, starting with the selection of the scenario:

model builder select scenario

And then selecting a folder with the Images.

model builder images for training

Important: Model Builder expects image data to be JPG or PNG files organized in folders that correspond to the categories of the classification.

To load images into Model Builder, provide the path to a single top-level directory:

  •     This top-level directory contains one subfolder for each of the categories to predict.
  •     Each subfolder contains the image files belonging to its category.

Once the folder is selected, we can see a preview of the images and labels loaded from the folder.

model builder folder selected image preview

For more information about how to organize images for this scenario, refer to Load training data into Model Builder.

And now we start the training process. This may take a while, depending on your hardware. I’m using the sample set of drawings that we used on the InsiderDev Tour, for Custom Vision. These are 24 drawings images, with 3 labels, and in a PC with a I7, 32GB of Ram and an SSD, the training process took a little longer than 2 minutes.

model builder train images complete

Once the training is complete, we have a decent accuracy in our model, so it’s time to test. Before Model Builder last step, we have the chance to test the model with some test images.

Using one of the images that I created at Ignite in Orlando, the trained model get’s a human with a 99% of accuracy.

model builder model trained test image

And, the final step is to add the generated model and code to our project. I’ll write about how to use this generated code on the near future.

model builder code generated

Happy Coding!

Greetings @ Burlington

El Bruno

References

#Event – #GlobalAIBootcamp, thanks to @AvanadeInc and @MicrosoftCanada, here are some resources, feedback and more !

Buy Me A Coffee

Hi !

The Global AI Bootcamp 2019 was a huge success, just take a look at this photo during the keynote

And remember, this was the weather during the day, cold and snow. Even so, we had ~200 attendees at the Microsoft Offices in Mississauga.

Speakers and Volunteers

We had an amazing set of volunteers and speakers, and I’m afraid I’m missing some names, so here it goes a photo of both:

Sponsors

Our 2 main sponsors were Avanade and Microsoft, thanks !

And, as we did in previous events, instead of having swag, we prefer to donate to a charity for every interaction we had at our booth!

Agenda

This year Agenda was amazing, and it’s tricky to summarize it in a single image

Take a look at this post: https://elbruno.com/2019/12/10/event-globalaibootcamp-2019-we-got-an-amazing-agenda-take-a-look/

Resources and Feedback

I’ll leave some feedback and general tweets at the end of this post.

As a bonus, here it goes my slides around Auto ML with Machine Learning.Net.

Here is the official Keynote:

Tweets

And tweets, more tweets

Happy Coding !

Greetings @ Burlington

El Bruno

#RaspberryPi – Microsoft Teams available on #linux, and this is the right way to install it

Buy Me A Coffee

Hi!

I’ve using Microsoft Teams in Windows 10 and MacOS and the experience is amazing. When I was trying to work only in my Raspberry Pi 4, having a native app was something I missed a lot. I mean, Microsoft Team web version is fine, however the desktop experience is much better.

And now, Microsoft announced that there is a Linux version of Microsoft Team, so I’m trying to manage my schedule during the next couple of days to test this in Raspbian in my Raspberry Pi 4.

We can download the native Linux packages in .deb and .rpm formats from https://teams.microsoft.com/downloads#allDevicesSection. Very cool to see all the available options

And I’m looking forward to check authentication, integrated services and more!

Happy coding!

Greetings @ Toronto

El Bruno  

References

My posts on El Bruno