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
Tensorboard Issue #932 #936
Conversation
@dotnet-policy-service agree |
@NiklasGustafsson Trying to implement other functions. |
As far as unit tests goes, you can't do much besides testing that it doesn't blow up on things like a null string, an empty string, non-ANSI strings, etc. You have to manually verify that it works and that Tensorboard can read it, for a few instances of those cases that make sense -- a null or empty string doesn't, for example. |
Note: I have not tested these codes. |
add_video will crash...
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.
looks good
Where did you find the pictures?
Since these are used in examples, it may be safer from a copyright perspective to download images at the beginning of the example logic and move them in place.
Niklas
Sent from Outlook<http://aka.ms/weboutlook>
________________________________
From: Kenneth Tang ***@***.***>
Sent: Friday, March 3, 2023 8:37 AM
To: dotnet/TorchSharp ***@***.***>
Cc: Niklas Gustafsson ***@***.***>; Mention ***@***.***>
Subject: Re: [dotnet/TorchSharp] Tensorboard Issue #932 (PR #936)
@ChengYen-Tang commented on this pull request.
________________________________
In src/Examples/Examples.csproj<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2FTorchSharp%2Fpull%2F936%23discussion_r1124712516&data=05%7C01%7CNiklas.Gustafsson%40microsoft.com%7Cc049dc0f0813432c773408db1c058dbf%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638134582404792176%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=If4Itgz46zT5oJIsNozD%2FQgUXjmTTYnm8ziY4ni8FaM%3D&reserved=0>:
+ <ItemGroup>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-0.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-1.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-2.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-3.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-4.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-5.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-6.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-7.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-8.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Update="TensorboardExample\Images\dd7bc686703f4166aac314395b2df4008tB05g8uJ00R9Ei8-9.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
I'm not sure if there are any copyright issues with these pictures, I randomly found a gif from the google as a test file. Are there any free gif available?
—
Reply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2FTorchSharp%2Fpull%2F936%23pullrequestreview-1324253455&data=05%7C01%7CNiklas.Gustafsson%40microsoft.com%7Cc049dc0f0813432c773408db1c058dbf%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638134582404792176%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=TYhGm2J2cT4PjDkhHHHUrKzfY%2FgBN07DpUcmQLd53RU%3D&reserved=0>, or unsubscribe<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAANVMB44TLAPUHZQVX4AIB3W2IM33ANCNFSM6AAAAAAVHE6PL4&data=05%7C01%7CNiklas.Gustafsson%40microsoft.com%7Cc049dc0f0813432c773408db1c058dbf%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638134582404792176%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EsCOQUpoGWASyiQpRuoovm3VZX2icXjZbssxaE4FbkQ%3D&reserved=0>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Earlier, you talked about drawing boxes in images -- where are you doing that? That should be fairly straightforward just using Tensors, right? I would think the Tensor type is great for image manipulation, and it's HW-accelerated, too. What I mean is: var t = zeros(1, 3, 32, 32, uint8);
var colon = TensorIndex.Colon;
var hLength = TensorIndex.Slice(2, 30);
var vLength = TensorIndex.Slice(2, 30);
t[colon, colon, 2, hLength] = (byte)0xFF;
t[colon, colon, 29, hLength] = (byte)0xFF;
t[colon, colon, vLength, 2] = (byte)0xFF;
t[colon, colon, vLength, 29] = (byte)0xFF; Should, unless I'm mistaken, draw a white box on an otherwise black background, two pixels from the edge. With .NET Core, it looks nicer since we can use language support for System.Range, but TorchSharp has to support both .NET Core and .NET FX. |
Because I found that pytorch SummaryWriter does not use the function to require a bounding box...so, I did not implement this method https://pytorch.org/docs/stable/tensorboard.html#torch.utils.tensorboard.writer.SummaryWriter |
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.
The program crashes in a certain state, but I can't find the reason...
|
only this problem |
Different parts of Android are covered by different licenses, so it's hard to say. |
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.
@NiklasGustafsson ,
I found that these codes seem to come from the source code of Android.
Are you know well with Android source code licence?
https://cs.android.com/android/platform/superproject/+/master:external/glide/LICENSE
The Unisys LZW patent seems to have expired and we can use it without restriction? |
I'm consulting with some internal people to see how we proceed. |
Okay, so I heard back -- if we add a section (or two) to the THIRD-PARTY-NOTICES.txt file that calls out the source of this code, we should be fine. |
src/Examples/Program.cs
Outdated
namespace TorchSharp.Examples | ||
{ | ||
public static class Program | ||
{ | ||
public static void Main(string[] args) | ||
public static async Task Main(string[] args) |
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.
It seems unnecessary to make this asynchronous. The program is a console app, and you have to await the result, anyway.
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.
Done.
@@ -628,17 +628,6 @@ public static Tensor[] meshgrid(IEnumerable<Tensor> tensors, string indexing = " | |||
/// </summary> | |||
public static Tensor roll(Tensor input, ReadOnlySpan<long> shifts, ReadOnlySpan<long> dims = default) => input.roll(shifts, dims); | |||
|
|||
// https://pytorch.org/docs/stable/generated/torch.searchsorted |
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 remove?
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.
@@ -0,0 +1,13 @@ | |||
namespace TorchSharp.Utils.tensorboard.Enums |
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.
Is this enum declared in two places?
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.
This enum has one more tensorflow item.
{ | ||
public static partial class tensorboard | ||
{ | ||
public static partial class GifEncoder |
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.
I don't think this class should be public.
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.
Done.
{ | ||
public static partial class tensorboard | ||
{ | ||
public static partial class GifEncoder |
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.
See previous comment. Should this be public?
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.
Done.
@ChengYen-Tang, I presume it's been tested now. |
Yes, tested |
I'll merge as soon as I get a successful build in Azure Pipelines (intermittent failures that have nothing to do with the library). |
#932