Skip to content

Commit

Permalink
added workaround for dotnet/TorchSharp#372
Browse files Browse the repository at this point in the history
(save is moving model to CPU)
  • Loading branch information
lostmsu committed Nov 17, 2021
1 parent 4df5623 commit d961e58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion asiren/CompressCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace LostTech.Torch.NN {
namespace LostTech.Torch.NN {
using System;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -70,6 +70,9 @@ public override int Run(string[] remainingArguments) {
Console.WriteLine($"saved! epoch: {eventArgs.Epoch} loss: {eventArgs.AvgLoss}");
lastUpgrade = eventArgs.Epoch;
// workaround for https://github.com/dotnet/TorchSharp/issues/372
siren = siren.to(device);
});

int batchesPerEpoch = samples.Length / this.BatchSize;
Expand Down

0 comments on commit d961e58

Please sign in to comment.