.npz file contains two npy files, faces.npy and neighbors.npy.
faces.npyisfloat64, shape is 12*15neighbors.npyisint64, shape is 12*3
First try:
Type is double[,], but neighbors is null
var npz = np.Load_Npz<double[,]>(@"D:\dnns\ifcnet\test\wall\IFCWALL.43.npz");
var faces = npz["faces.npy"];
var neighbors = npz["neighbors.npy"];
Second try:
Type is Int64[,], but faces is null
var npz = np.Load_Npz<In[,]>(@"D:\dnns\ifcnet\test\wall\IFCWALL.43.npz");
var faces = npz["faces.npy"];
var neighbors = npz["neighbors.npy"];
Third try:
Read faces by double[,], and read neighbors by Int64[,], but when reading the same file, another process uses the file!
var npz = np.Load_Npz<double[,]>(@"D:\dnns\ifcnet\test\wall\IFCWALL.43.npz");
var faces = npz["faces.npy"];
var npz2 = np.Load_Npz<Int64[,]>(@"D:\dnns\ifcnet\test\wall\IFCWALL.43.npz");
var neighbors= npz2["neighbors.npy"];
My speculation is that loading NPZ with multiple type is not supported.
My approach to this problem is to load NPZ file as
ZipArchive, then open the stream, then feed it to theloadfunction.Notice that I use
loadinstead ofLoad<T>. This way, you can load multiple types of arrays without prior knowledge of the array.Note:
Load<float[,]>fails with some random files, butloadworked reliably.