shaltielshmid / TorchSharp.PyBridge

A library enabling easy transfer and handling of PyTorch models between .NET and Python environments
MIT License
14 stars 3 forks source link

load pth weight file error #18

Open dongfangzhizhu opened 4 months ago

dongfangzhizhu commented 4 months ago

on file PyTorchUnpickler code line 163 torch.Tensor t = torch.WrappedTensorDisposeScope(() => torch.empty(shape, arg0.dtype).as_strided(shape, stride, storageOffset));

when load file segment-anything sam_vit_b_01ec64.pth pth file,it's error:System.Runtime.InteropServices.ExternalException:“setStorage: sizes [4, 256], strides [256, 1], storage offset 256, and itemsize 4 requiring a storage size of 5120 are out of bounds for storage of size 4096. look like it's shape mismatch