#Python – How to fix “ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)” on #Windows10 #TensorFlow

Buy Me A Coffee

Hi!

Ok, I’ll write this down. I face this issue from time to time, and then after some searching and reading, I found the solution (again!) and I realize I’ve been done this before.

So, I’m installing Tensorflow on Windows with the amazing single command

# Requires the latest pip
pip install --upgrade pip
# Current stable release for CPU and GPU
pip install tensorflow

And then I get this error

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) 
ERROR: No matching distribution found for tensorflow
error installing tensor flow on windows

So, I decided to see what’s happened and I realize that I only have installed Python 3.8. And there is no official TF version for Python 3.8. So, I need to downgrade Python to 3.7.

Time to install earlier Python version

python current version 3.7.6

and then, try to install TensorFlow again. Now, it’s installing

installing tensorflow with current python version

and after installation, test current TF version

tensorflow installed and tested on windows terminal

So, remember: Using the latest Python version, does not warranty to have all the desired packed up to date. Specially with TensorFlow.

Happy coding!

Greetings

El Bruno

References

#RaspberryPi – Visual Studio Code blank screen is fixed on version 1.42. Thanks @headmelted! @code

Buy Me A Coffee

Hi!

When I wrote about how to install Visual Studio Code on a Raspberry Pi, there was an error on the app running on the device: the tool opened and display a black window.

We needed to manually go back to version 1.29 to avoid this problem. And we also forgot to apply any updates, each new version still have the black window error.

I was following the issue on GitHub, and I was happy when a few days ago, it was solved by headmelted (link https://github.com/headmelted/codebuilds/issues/67#issuecomment-563335451).

I’ve updated the app to the latest version (1.42.0), and it was working fine.

raspberry pi 4 visual studio code version 1.42 running fine

If we check the apt list, we can find a specific detail of the running version with the command

sudo apt list --installed | grep -i code-oss
raspberry pi 4 apt list for code -oss return 1.42

So, please go and thank headmelted by the amazing work he is doing!

Happy coding!

Greetings

El Bruno

My posts on Raspberry Pi

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

#VS2019 – How to fix the [obj\project.assets.json’ not found] when building a #NetCore project

Buy Me A Coffee

Hi!

Quick post today. This one is to save me 30 minutes of internet search next time I face this error.

Context:

New .Net Core Console App.

When I build the console app for the 1st time I got this error.

  • Error: NETSDK1004
  • Assets file ‘<Path> \EventConsoleApp01\obj\project.assets.json’ not found.
  • Run a NuGet package restore to generate this file.
  • C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets
visual studio 2019 new dotnet core console error on 1st build, cant find assets json.jpg

It’s a very silly error. However, if you are old school, the standard methods to fix this won’t work.

So the right way to fix this is to open the NuGet Package Manager Console [Tools // Nuget Package Manager / Package Manager Console] and type the command

dotnet restore
visual studio 2019 dotnet restore on nuget package manager console.jpg

Then rebuild the project, and that’s it! The new build will restore all the package, and also install everything necessary for a console app to run

visual studio 2019 project after dotnet restore.jpg

Happy coding!

Greetings @ Toronto

El Bruno

#MLNET – Fix the error [System. InvalidOperationException, Entry Point ‘ Not found] when you train a pipeline

Hi!

Today I’m going to leave this POST as a memory backup for me because I always forget to make this configuration in ML.Net projects and I always find the following error:

System.InvalidOperationException

  HResult=0x80131509

  Message=Entry point ‘<some external assembly> not found

  Source=Microsoft.ML.Data

Where [External Assembly] can be For example LightGBM

  Message=Entry point ‘Trainers.LightGbmClassifier’ not found

01 mlnet entry point not found

This error triggered when the app is running, at the beginning of a pipeline training. It is usually associated with scenarios where we add and use external references in addition to Microsoft.ML.

The solution is quite simple, we just have to make sure that the Project Property <CopyLocalLockFileAssemblies> this enabled

02 mlnet project config CopyLocalLockFileAssemblies

Editing the csproj file like this

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
  </PropertyGroup>

And ready, now our pipelines can train properly!

Happy Coding!

Greetings @ Burlington

El Bruno

References

My Posts

#MLNET – Solución para el error [System.InvalidOperationException, Entry point ‘ not found] al momento de entrenar un Pipeline

Buenas!

Hoy voy a dejar este post como un ayuda memoria de algo que me olvido siempre en los proyectos de ML.Net y siempre me encuentro con el siguiente error.

System.InvalidOperationException

  HResult=0x80131509

  Message=Entry point ‘<some external assembly> not found

  Source=Microsoft.ML.Data

Donde el [External Assembly] puede ser por ejemplo LightGBM

  Message=Entry point ‘Trainers.LightGbmClassifier’ not found

01 mlnet entry point not found

Este error es de ejecución y se da al momento de comenzar el entrenamiento de un Pipeline. Suele estar asociado a escenarios donde agregamos una referencia externa además de Microsoft.ML.

La solución es bastante simple, solo debemos asegurarnos que la propiedad de proyecto <CopyLocalLockFileAssemblies> este habilitado

02 mlnet project config CopyLocalLockFileAssemblies

Editando el csproj de la siguiente manera

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup Label="Globals">
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
  </PropertyGroup>

Y listo, ahora nuestros pipelines pueden entrenar correctamente!

Happy Coding!

Saludos @ Burlington

El Bruno

References

My Posts

#MLNET – Error ‘Entry point ‘Trainers.LightGbmClassifier’ not found’ and how to fix it

Hi!

Monday Tip hoping to save you some time if someone finds this error

I1

System.InvalidOperationException: ‘Entry point ‘Trainers.LightGbmClassifier’ not found’

Before going on, let me share a little context. In the current version of Machine Learning.Net [0.3.0] we have a couple of new Trainers. One of them is LightGBM. This Framework allows us to perform supervised sorting tasks in binary mode, multiple categories and more. In the MSDN blog post for the version 0.3.0 of ML.Net, this framework is well described, with also a very interesting definition

The definition for LightGBM in ‘Machine Learning lingo’ is: A high-performance gradient boosting framework based on decision tree algorithms.

Well after choosing a test data set which I know well, I decided to move on and try this new Trainer. Once I had created all the infrastructure necessary to use the Framework, I found the error I mentioned at the beginning of the post. And I didn’t like it at all. If you know a little bit of Windows, you know that type errors [Entry Point] never predict anything good.

Well, it was time to start investigating what was going on. I will not enumerate all the steps and tests I did, but only comment that I get to download and debug the source code of Machine Learning.Net. Although as usually happens in these cases, the solution was much simpler. Just look at the following lines of code

I2

You have to download a NuGet package to use LightBGM!

15 seconds later I had everything up and running to try the new Trainer!

I3

Happy Coding!

Greetings @ Toronto

El Bruno

References

My Posts

#MLNET – Error ‘Entry point ‘Trainers.LightGbmClassifier’ not found’ y como solucionarlo

Buenas!

Tip de lunes con la esperanza de ahorrarle un poco de tiempo si alguien se encuentra este error

I1

System.InvalidOperationException: ‘Entry point ‘Trainers.LightGbmClassifier’ not found’

Antes de seguir un poco de contexto. En la version actual de Machine Learning.Net [0.3.0] tenemos varios nuevos trainers y uno de ellos es LightGBM. Este framework nos permite realizar tareas supervisadas de clasificación en modo binario, multiples categorías y varias opciones mas. En el post de introducción a la version 0.3.0 de ML.Net se presenta el mismo, y además con una definición bastante interesante

The definition for LightGBM in ‘Machine Learning lingo’ is: A high-performance gradient boosting framework based on decision tree algorithms.

Pues bien, después de elegir un set de datos de prueba que conozco bastante bien, me decidi a probar este trainer. Una vez que hube creado toda la infraestructura necesaria para utilizar el framework, me encontré con el error que menciono al principio del post. Y no me gusto nada. Si conoces un poco de Windows, sabes que los errores de tipo [Entry point], nunca auguran nada bueno.

Pues bien, fue el momento de comenzar a investigar que pasaba. No voy a enumerar todos los pasos y pruebas que hice, pero solo comentare que llegue a descargar y depurar el source code de Machine Learning.Net. Aunque como suele suceder en estos casos, la solución era mucho más simple. Solo hay que ver las siguientes líneas de código

I2

Hay que descargar un paquete NuGet para utilizar LightBGM!

15 segundos después ya tenia todo up and running para probar el nuevo trainer!

I3

Happy Coding!

Greetings @ Toronto

El Bruno

References

My Posts

#DevOps – WebSites, Azure and Error: Multiple types were found that match the controller named ‘messages’.

Hi!

I’ll leave it written down in a post so I will not forget later. Let’s start with the context

  • We work with a web App. For example, a Microsoft Bot App with Visual Studio
  • The deployment of it is done to Azure as part of an automated process (DevOps rules!)
  • Everything works perfectly

Until in a moment you find that your Web App does not work anymore. And when you try to navigate one of the controllers, a message like the following may appear

Multiple types were found that match the controller named ‘messages’. This can happen if the route that services this request (‘api/{controller}/{id}’) found multiple controllers defined with the same name but differing namespaces …

There are several reasons why this usually happens. However, one of the most popular is that you have renamed or changed some namespaces and new Dlls have been generated as part of the solution. The problem is that, by default, and as a mechanism to save processing time, the deployments only copy the assemblies that have been modified to the destination location. In this case, to an IIS folder, so a mix of files is in the bin folder.

Before continuing I have to take up the words of the great  Damian Brady (@damovisa):

Friends don’t let friends right-click publish

The first time you have seen an option that allows you to clean the destination directory and then copy the compilation directory is in the Publish option of a website in Visual Studio 2017

I1

Well, if you have configured the publication of your website as part of a Build – Releases process, it is in this last section that you will find the option [Remove additional files at destination], which will eliminate the unnecessary Assemblies of your solution.

I2

Happy Coding!

Greetings @ Toronto

El Bruno

#DevOps – WebSites, Azure y multiples controllers. Error: Multiple types were found that match the controller named ‘messages’.

Buenas!

Lo voy a dejar apuntado en un post para que luego no me olvide. Comencemos por el contexto

  • Trabajamos con una App web. Por ejemplo, una Microsoft Bot App con Visual Studio
  • El despliegue de la misma se realiza a Azure como parte de un proceso automatizado (DevOps rules!)
  • Todo funciona perfectamente

Hasta que en un momento te encuentras que tu Web App no funciona más. Y cuando intentas navegar uno de los controllers, puede aparecer un mensaje como el siguiente

Multiple types were found that match the controller named ‘messages’. This can happen if the route that services this request (‘api/{controller}/{id}’) found multiple controllers defined with the same name but differing namespaces …

Hay varios motivos por los que suele suceder esto. Sin embargo uno de los mas populares es que has renombrado o cambiado algunos namespaces y se han generado nuevas Dlls como parte de la solución. El problema está en que, por defecto, y como mecanismo para ahorrar trabajo, los despliegues solo copian los ensamblados que se han modificado a la ubicación de destino. En este caso, a un folder de IIS.

Antes de seguir tengo que retomar las palabras del gran Damian Brady (@damovisa):

Friends don’t let friends right-click publish

La 1ra vez que has visto una opción que te permite limpiar el directorio de destino y luego copiar el directorio de compilación es en la opción Publish de un website en Visual Studio 2017

I1

Pues bien, si has configurado la publicación de tu website como parte de un proceso de Build – Releases, es en esta última sección donde encontraras la opción [Remove additional files at destination], que eliminara los Assemblies innecesarios de tu solución

I2

Happy Coding!

Saludos @ Burlington

El Bruno