-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixes #4299 related to ML.Samples and ML.Samples.GPU sharing the same Program.cs file #4300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
483b22e
Adding a Program.cs to ML.Samples.GPU project, different from the one…
antoniovs1029 58dcb47
Removing the content in the ML.Samples.GPU main method
antoniovs1029 3b7e78f
Put again the original content of Program.cs in the ML.Samples.GPU p…
antoniovs1029 aebbd78
Merge remote-tracking branch 'upstream/master' into samplesgpu
antoniovs1029 1d2ac0c
Merge from master branch
antoniovs1029 406f4c9
Remove original Program.cs from Samples.GPU references
antoniovs1029 13435b3
Merge branch 'samplesgpu' of https://github.com/antoniovs1029/machine…
antoniovs1029 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() | ||
| { | ||
| 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); | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this empty?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.