Zarr open()返回FSPathExistNotDir错误



当我运行zarr.open('result.zarr', mode='r')时,我得到以下错误:

FSPathExistNotDir: path存在但不是目录:%r

根据位于https://zarr.readthedocs.io/en/stable/tutorial.html#persistent-arrays的Zarr文档中的示例,这个Zarr .open()函数应该返回一个Zarr .core. array:

z2 = zarr.open('data/example.zarr', mode='r')
np.all(z1[:] == z2[:])

为什么zarr.open()函数在我的情况下寻找一个目录?

我明白我的困惑了。对我来说,example.zarr是文件的名称(似乎我错误地命名了它),而不是目录。

我也很困惑,因为zarr.open()创建一个zarray,但不像函数名所暗示的那样打开一个现有的zarray。从kaggle.com/kneroma/zarr-files-and-l5kit-data-for-dummies:

z1 = zarr.open('data/example.zarr', mode='w', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4') z1

上面的数组将存储其配置元数据和所有内容压缩块数据在名为data/example.zarr的目录下相对于当前工作目录。zarr.convenience.open()函数提供了一种方便的方法创建新的持久数组或继续使用现有的数组。

相关内容

  • 没有找到相关文章

最新更新