Open khaotik opened 3 years ago
npz format is based on the zip file standard. In zip files, filenames beginning with a /
are not allowed.
4.4.17 file name: (Variable)
4.4.17.1 The name of the file, with optional relative path. The path stored MUST NOT contain a drive or device letter, or a leading slash. All slashes MUST be forward slashes '/' as opposed to backwards slashes '\' for compatibility with Amiga and UNIX file systems etc. If input came from standard input, there is no file name field.
For reference, we're using below zip implementation which, unlike Python / Numpy, enforces the filename requirements.
Unfortunately this looks like a bug in numpy. We can consider following numpy here in writing non-standard zip files, but that's not supported by our current zip implementation.
Description
A minor issue:
mx.numpy_extension.savez
does not accept array-dict with a key starting with slash. This started to occur as soon as I upgraded to master fork. It is also inconsistent with numpy behavior.This function is used by
gluon.Block.save_parameters
methods.Error Message
To Reproduce
What have you tried to solve it?
In file
python/mxnet/numpy_extension/utils.py
, substituteNDArraySave
withNDArrayLegacySave
provides a temp fix. Also, the issue can be avoided by not using slash as parameter name prefix.Environment
ubuntu 20.04 anaconda py 3.8.3 mxnet master branch commit cb5bd4ea8b6fc9b568c13747bdb006ac047b72b5