david-di opened a new issue #15927: sym.Variable input init need init.dumps(), but NDarray is not JSON serializable URL: https://github.com/apache/incubator-mxnet/issues/15927 ## Description mxnet.symbol.Variable(name, attr=None, shape=None, lr_mult=None, wd_mult=None, dtype=None, init=None, stype=None, **kwargs) The input parameter init, I used mxnet.initializer.Constant(value). The introduction of Constant class says "Initializes the weights to a given value. The value passed in can be a scalar or a NDarray that matches the shape of the parameter to be set", so I use a NDarray as "value" parameter. Now, accident happened...... In class Variable, if init is not an instance of string, init.dumps() will be called. "dumps" method is implemented in class mxnet.initializer.Initializer, the superclass of Constant. ``` def dumps(self): return json.dumps([self.__class__.__name__.lower(), self._kwargs]) ``` NDarray is not JSON serializable... Crash...
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
