Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

build mxnet from source and get ImportError: cannot import name 'NDArrayHandle' #17577

Open
a550461053 opened this issue Feb 12, 2020 · 1 comment
Assignees

Comments

@a550461053
Copy link

  • I build mxnet from source, here's the steps:
git clone --recursive https://github.com/apache/incubator-mxnet
cd incubator-mxnet
cp make/config.mk ./
# change config.mk to set: USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 USE_DIST_KVSTORE=1 USE_NCCL=0 
make -j $(nproc)
cd python/ && pip install --user -e .
  • I got ImportError: cannot import name 'NDArrayHandle when I test mxnet in python.
    from mxnet.kvstore import NDArrayHandle

  • Then I list the kvstore class:

  1. In release mxnet-cu100:
>>> import mxnet.kvstore as kv
>>> dir(kv)
['KVStore', 'KVStoreHandle', 'NDArray', 'NDArrayHandle', '_LIB', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_ctype_dict', '_ctype_key_value', '_get_kvstore_server_command_type', '_ndarray_cls', '_updater_wrapper', 'absolute_import', 'array', 'c_array', 'c_array_buf', 'c_handle_array', 'c_str', 'c_str_array', 'check_call', 'create', 'ctypes', 'mx_uint', 'opt', 'pickle', 'py_str', 'set_kvstore_handle', 'string_types']
  1. In my build mxnet:
>>> dir(kv)                                                                                                                     │·
['KVStore', 'KVStoreBase', 'KVStoreServer', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__pa│·
ckage__', '__path__', '__spec__', 'base', 'create', 'kvstore', 'kvstore_server']

I want to know why it happen and what's the default config.mk of the released mxnet wheel.

@samskalicky
Copy link
Contributor

@apeforest any idea on kvstore?

@apeforest apeforest self-assigned this Feb 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants