Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was 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

Description

@ziqi-wlb
  • 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions