You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/27 08:13:45 UTC

[GitHub] cloudhan opened a new issue #9208: ndarray load and save should be device agnostic

cloudhan opened a new issue #9208: ndarray load and save should be device agnostic
URL: https://github.com/apache/incubator-mxnet/issues/9208
 
 
   I have a set of saved parameter files with `mx.nd.save(...)`, the problem is that they are on gpu 7 before saving and I copy them to another machine with only 2 GPUs. When I try to load them I encounter the problem:
   ```
   Check failed: e == cudaSuccess CUDA: invalid device ordinal
   ``` 
   I know I can copy them to whatever device before saving. But what if the user loss access to those devices after dumping the ndarray to a file? 
   
   So I think the better default saving and loading mechanism should as following:
   
   `mx.nd.save(fname, data)` should be `mx.nd.save(fname, data, keep_ctx=False)` 
   that is, it save the parameter with cpu device by default, the user can override this default behavior, and they are on their own.
   
   and 
   
   `mx.nd.load(fname)`  should be `mx.nd.load(fname, as_in_ctx=None)` 
   `as_in_ctx` is a parameter of device or list of devices, this way, the loaded ndarray will be ready for binding (I am still using the old api) after this single invocation.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services