Microsoft ML can't use opset 11 despite nuget package installed - ml.net

I'm trying to build a simple object detection runner, really just following this MS Docs guide: https://learn.microsoft.com/en-us/windows/ai/windows-ml/tutorials/tensorflow-deploy-model
I already figured out building the View and adding capabilities so the provided code actually compiles.
Just one more problem right now: When creating the session, it crashes claiming "Unknown model file format version" which seems to translate to "Opset of the model you use is not supported".
Looking at github issues google showed me, I'm supposed to install the Microsoft.AI.MachineLearning nuget package and all is well. Except when I installed it, nothing changed.
So, what's left to do beside open yet another github issue? I already re-exported my model from opset 15 to opset 11 because the nuget package only supports that.
I'm on windows 10, UWP targeting 2004.

Related

ExtensionsMetadataGenerator error when upgrading Azure Functions SDK

I upgraded my azure function sdk from 1.0.14 to 1.0.28 and I get this build error:
The ExtensionsMetadataGenerator package was not imported correctly.
I can't find any documentation or ways to resolve it.
According to the 1.0.28 function sdk released several day ago, it may have some bugs in it.
Workaround:
Manually adding the
Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator nuget package to your project and it will work well.
I got this error when starting with the Visual Studio Function App template which uses Microsoft.NET.Sdk.Functions 1.0.31 and is a .NET Core 2.0 App.
Nuget Package Manager wants to update the Microsoft.NET.Sdk.Functions package to version 3.0.2 which it tries to do but the app is still .NET Core 2 and you get the error:
The ExtensionsMetadataGenerator package was not imported correctly.
To resolve this update the application to .NET Core 3:
Make sure you update your Microsoft.NET.Sdk.Functions NuGet package to the newest version that supports your app's version of .NET.
For example, I have a web app running .NET 2.1, I had to rollback the NuGet version to 1.0.36, and the next version (3.0) only worked on .NET 3 and up. After doing this, Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator NuGet was not needed at all and all my errors were gone.
I am working with microsoft.net.sdk.functions 1.0.38 and see the same message but in my case it is a build warning and not an error.
I installed the suggested NuGet package with the version required. However, I then received 3 warnings:
The ExtensionsMetadataGenerator package was not imported correctly. Are you missing 'C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets' or 'C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props'? "C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props" cannot be imported again. It was already imported at "C:\Users\me\.nuget\packages\microsoft.net.sdk.functions\1.0.38\build\Microsoft.NET.Sdk.Functions.props (56,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\myproject.Web\myproject.Web.AzureFunctions\myproject.Web.AzureFunctions.csproj] "C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets" cannot be imported again. It was already imported at "C:\Users\me\.nuget\packages\microsoft.net.sdk.functions\1.0.38\build\Microsoft.NET.Sdk.Functions.targets (64,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\myproject.Web\myproject.Web.AzureFunctions\myproject.Web.AzureFunctions.csproj]
Worse still my project would not build - it freezes on build with no way to cancel. The only way to cancel was to do, elevated PowerShell:
stop-process -name "dotnet"
To fix this I tried uninstalling the NuGet package but this is not enough as it still seems to be used if it is on the system (even though the project does not reference it?!?).
It is necessary to actually delete the package from package store, i.e. at.
C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator
Or an alternative is to comment out the lines:
<GenerateFunctionsExtensionsMetadata SourcePath="$(_FunctionsExtensionsDir)" OutputPath="$(_FunctionsExtensionsDir)"/>
From:
C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets
I have no idea if this is safe to do so but it gets rid of the warning message. I instead opted to just delete the NuGet package and live with the original warning.
Looks like a real mess with microsoft.net.sdk.functions package.

VSTS feed "refresh" mechanism in Visual Studio

I have set up a VSTS nuget feed. And I have pushed some packages two days ago. I was able to add those packages to my project. But I needed to push an other version for one of them. Made new nupgk version, pushed it and I can see it in VSTS, I can download it from there, Visual Studio 2017 is also listing it correctly but when I try to install it, I am getting an error:
Package 'whatever 1.0.1' is not found in the following primary source(s): 'https://whatever.pkgs.visualstudio.com/_packaging/feedname/nuget/v3/index.json'. Please verify all your online package sources are available (OR) package id, version are specified correctly. 0
What I have tried:
- waiting around 10 minutes
- restarted Visual Studio several times
- pasting the above url into a browser and refreshing it manually several times
One or more of these helped. But I would like to know if there is any canonic solution for that.
I used the answer widget to have some formatting. Still, this might not be "the" answer, as I don't know the mechanism beyond. But it looks to be a workaround.
Steps:
Create a solution with a library project (let's call it L01)
Add another library project to the solution (let's call it D01)
Make a nuget package from L01 (version 0.0.1)
Push the package to your VSTS feed
Manage packages for project D01 and browse your feed
Package L01 v0.0.1 will be listed
Add it to project D01, it will work
Edit L01 nuspec file and change version to 0.0.2
Build and push the new package
Go back to project D01 and refresh the package list. The update will be shown.
Try to update. It will fail with the error message from my question.
Now go to folder %localappdata%\NuGet\v3-cache (or equivalent)
Locate the folder corresponding to your feed and open it
Locate list_l01.lib_index.dat (where l01 is the package name) and delete it
Go back to project D01 and try to install the update. It will succeed.
Would be good if others could confirm. I have reproduced this several times.
Seems you are trying to download the package or packages that where just freshly pushed to VSTS nuget feed.
Since Visual Studio 2017 is listing it correctly, then the issue should not related to the feed on VSTS server.
If this occurs very recently(download the new refresh package) and your package is very large, this maybe a network delay. Suggest you use a fiddler trace when this issue happens again. This makes "some" sense, what you see is probably an incorrect propagation of pushed packages showing up in the search results but not yet available to download.
And some other also encounter the same issue and error as you.
FYI, I've been seeing this exact issue in the past month or so.
Switching between sources, uninstalling and reinstalling are some work
arounds, but not 100%. Pushing my own packages up to VSTS and then
it takes like 15 minutes to finally get it to install.
More details please take a look at this similar issue Package update not found when updating via Visual Studio Solution

VS2017 RC1 Installation installation error - Microsoft.PortableLibrary.TargetingPack.Msi failed - No XAML

I had errors installing VS2017 with
Package 'Microsoft.PortableLibrary.TargetingPack.Msi,version=15.0.26004.1' failed to install
The actual IDE will open but I don't have any XAML functionality - it appeared to fail the installation before this component was installed. XAML files won't load and there is no XAML listed under 'Text Editor'.
How to fix this error?
After several hours finally managed to get it to work:
Still not sure exactly what a targeting pack is - and why VS couldn't install it but I manually installed this package and managed to get it to work:
Manually installed:
Microsoft .NET Framework 4.6.2 Developer Pack and Language Packs
https://www.microsoft.com/en-us/download/details.aspx?id=53321
Other things I did that may have contributed to the solution:
I rebooted
I removed all files in C:\ProgramData\Microsoft\VisualStudio\Packages - actually I moved them to an OLD folder and later deleted them. You will see packages downloaded here after you restart the install.
I had previously created a symbolic link from %ProgramData%\Package Cache to another drive to save space (https://superuser.com/questions/455853/can-i-delete-the-folder-c-programdata-package-cache). This symbolic link didn't seem to work anymore leaving me with some files in %ProgramData%\Package Cache and the rest in the other drive. I moved them over and recreated the link. If this is something you did to save disk space and forgot then that could contribute towards a failed solution.
Something above fixed the issue and I now have XAML back again.
Note: The VS2017 RC1 does not support offline installation so that was another avenue I explored and gave up on. The command line switches currently do NOTHING.
I believe the package I needed is the following one but not absolutely sure.
C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.PortableLibrary.TargetingPack.Msi,version=15.0.25719.0

Sitecore Glass.Mapper.Sc vs Glass.Mapper.Sc.Core

Hi Fellow Sitecoryians ,
I'm in the process of upgrading a website sitting on Sitecore 7.1 rev140130 webforms to Sitecore 8.2rev160729 MVC-5 / Webforms hybrid. I require to keep the old content running. Because this is just an upgrade of the backend. But plan to start developing in MVC for all new components etc. I will phase out the old web forms as content pages change. This requirement is pushed on me by the business.
The old site used Glass Mapper to generate and map content from sitecore. Using the old Glass.Mapper.Sc.CasteWindsor v3.2.1.21 via t4 scripts in TDS.
I looked over the Glass homepage. Where is states that Glass.Mapper.Sc is all that you require now. But there are conflicting tutorials out there stating you need to install the MVC-4 or MVC-5. I figured I would ignore them for now and stick to the Glass suggested install.
Trouble is that the old Model properties are tagged with attributes like
[SitecoreId] & [SitecoreInfo(SitecoreInfoType.Language)]
Which don't seem to be in the Glass.Mapper.Sc library. The only reference I can find of these attributes in the available nugets packages. Is the Glass.Mapper.Sc.Core package.
I tried to install that package in the models project. Just to see this :
Start package installation to project [project].Logic.Models
Installation failed. Rolling back...
Error: Unable to resolve dependencies. 'Glass.Mapper.Sc.Core 4.2.1.189' is not > compatible with 'Glass.Mapper.Sc 4.3.1.194 constraint: Glass.Mapper.Sc.Core (≥ > 4.3.1.194)'.
Installation finished.
I feel like I might be making a mistake if I down-grade the Glass.Mapper.Sc so I can install the Core library. I might be shooting myself in the foot later on. Because I still have to install WFFM and Social Connection Module being replace with the internal sc8 social components..
My understanding was that the new Glass.Mapper.Sc package should cover all my needs.
So should I down grade and try and use the older version with the Core libraries?
Or should I refactor the models to use a new attribute system. What ever that may be?
(Keep in mind there are around 50+ models in the project. So it's not something that I would like to have to do .. )
Glass Mapper was significantly changed in version 4 and the biggest change was the removal and reliance on Castle Windsor. A list of the changes were listed in the release blog post.
The Nuget package/installer has also been changed so there is now only a single Nuget package instead of the several which you previously had to install. To support this, the Nuget installer checks for the presence of Sitecore.Kernel.dll and System.Web.Mvc:
To make things simpler V4 uses a Powershell script to decided which references to add to your project, it checks both the Sitecore.Kernel version and the System.Web.Mvc version and then installs the appropriate Glass.Mapper.Sc and Glass.Mapper.Sc.Mvc assembly.
My suggestion would be to remove the old V3 assemblies and Nuget references, make sure the above 2 DLLs are correctly referenced in your project(s) and then install Glass V4 Nuget to those projects again.
The SitecoreId and SitecoreInfo attributes are still in the Glass.Mapper.Sc library, the Core library has been removed/refactored. I don't believe this namespace has changed since V3 but make sure you are using the GlassV3Header.tt file and the using Glass.Mapper.Sc.Configuration.Attributes namespace is correct in that file.
https://github.com/HedgehogDevelopment/tds-codegen/blob/master/Sitecore.Master/Code%20Generation%20Templates/GlassV3Header.tt#L32

Trying to switch from Xunit.KRunner to xunit.runner.kre?

Today after updating our projects it seems Xunit.KRunner is no longer available on NuGet. We checked the Microsoft projects and it looks like they are using the xunit.runner.kre package. When trying to install this the xunit.assert assemly is failing to download from Nuget. Any suggestions to get this working? I am guessing that the versions are messed up.
Here are my nuget package locations:
I'm also using the beta2 version of the kre.
There is/was an issue with the new xunit.runner.kre and VS CTP 5. See below discussion:
https://github.com/aspnet/Testing/issues/65
xunit.runner.xre is available only on myget/vnext feed. Include that in the Nuget.config that you should be able to restore the package
By running on the beta2 kre you're then having mismatched dependencies. If you look at the versions of your xunit bits they're all beta3. I'd recommend upping your kre to beta3 to fix your issue (will affect which packages your app pulls in).
Also as a side note I'd recommend ensuring your nuget.org/api/v2/ feed is enabled (in the SS you posted it wasn't). There's currently an issue where it'll occasionally disable itself; has definitely made my life frustrating several times when things don't build :).