Skip to content

Missing dependency in 0.96.7 calling TorchSharp.torchvision.datasets.MNIST #629

@dayo05

Description

@dayo05

I got error about

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73'
   at TorchSharp.Utils.Decompress.DecompressGZipFile(String gzipFileName, String targetDir)
   at TorchSharp.torchvision.Modules.MNIST.DecompressFile(String file, String sourceDir, String targetDir)
   at TorchSharp.torchvision.Modules.MNIST.Download(String root, String baseUrl, String dataset)
   at TorchSharp.torchvision.Modules.MNIST..ctor(String root, String datasetName, String prefix, String baseUrl, Boolean download, ITransform transform)
   at TorchSharp.torchvision.Modules.MNIST..ctor(String root, Boolean train, Boolean download, ITransform transform)
   at TorchSharp.torchvision.datasets.MNIST(String root, Boolean train, Boolean download, ITransform target_transform)
   at Program.<Main>$(String[] args) in /home/dayo/RiderProjects/RnE/RnE/Program.cs:line 8

in code

using System;
using static TorchSharp.torch;
using static TorchSharp.torch.utils.data;
using static TorchSharp.torchvision.datasets;

Console.WriteLine(cuda.is_available());

var mnistTrain = MNIST("data", true, true);
var mnistTest = MNIST("data", false, true);
var train = new DataLoader(mnistTrain, 64, true, CUDA);
var test = new DataLoader(mnistTest, 64, false, CUDA);

Console.WriteLine(train.Count);
Console.WriteLine(test.Count);

I think this has caused by missing dependency on version 0.96.7

In Issue #390 @dsyme suggests moving TorchSharp.dll to TorchSharp.Core.dll.
If that will approved, I think TorchSharp.torchvision.datasets class should be divided to other assembly in this case.

If #390 will not approved, TorchSharp nuget package should mark ICSharpCode.SharpZipLib, Version=1.3.3.11 as dependency.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions