Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Microsoft.ML.Samples\Program.cs" Link="Program.cs" />
<Compile Include="..\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\*.cs">
<Link>Dynamic\ImageClassification\%(FileName)</Link>
</Compile>
Expand Down
30 changes: 30 additions & 0 deletions docs/samples/Microsoft.ML.Samples.GPU/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Reflection;
using Samples.Dynamic;

namespace Microsoft.ML.Samples
{
public static class Program
{
public static void Main(string[] args) => RunAll();

internal static void RunAll()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this empty?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I wrote in the issue, I got runtime errors if I tried to run it with the original content of Program.cs. So I removed that.

Should I put that back into the method?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What were the errors? Did you run the samples on a machine with a GPU?
If there are errors, then the samples that throw them should be fixed.


In reply to: 331726596 [](ancestors = 331726596)

@antoniovs1029 antoniovs1029 Oct 7, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My machine doesn't have a dedicated GPU. And now I realize that the exceptions were thrown because I don't have tensorflow installed either.

I will find a machine that has those to run the samples, and if it works then I will return the content of Program.cs.

Thanks for the feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I had checked this on another machine, and the samples run with the original content of the Program.cs file, so I've put that back in here.

So, please, approve this PR. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So today I got my machine with a GPU running. And I checked that this works as expected; everything went correctly. Please, approve this PR. Thanks!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for verifying that the samples run correctly!
Since they are, is this PR still needed? This file is identical to the one in Microsoft.ML.Samples, isn't it?


In reply to: 337241467 [](ancestors = 337241467)

@antoniovs1029 antoniovs1029 Oct 22, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are identical. The problem was that both projects shared the same file, and when editing the file under ML.Samples to run a specific sample, then some error tooltips appeared when editing it and some build errors occurred when trying to rebuild the solution after making those changes in that file. This happened because ML.Samples.GPU doesn't have access to the same things that ML.Samples.

So these errors didn't appear before, and after talking about it with @codemzs we agreed that I should add another Program.cs file in ML.Samples.GPU with the same content of the one in ML.Samples.

{
int samples = 0;
var types = Assembly.GetExecutingAssembly().GetTypes();
foreach (var type in types)
{
var sample = type.GetMethod("Example", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);

if (sample != null)
{
Console.WriteLine(type.Name);
sample.Invoke(null, null);
samples++;
}
}

Console.WriteLine("Number of samples that ran without any exception: " + samples);
}
}
}