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

cpp-package lenet example throws exception #5621

Closed
cjolivier01 opened this issue Mar 29, 2017 · 2 comments
Closed

cpp-package lenet example throws exception #5621

cjolivier01 opened this issue Mar 29, 2017 · 2 comments

Comments

@cjolivier01
Copy link
Member

For bugs or installation issues, please provide the following information.
The more information you provide, the more likely people will be able to help you.

Environment info

Operating System:
Ubuntu 16.04

Compiler:
gcc 5.2

Package used (Python/R/Scala/Julia):
cpp-package

MXNet version:

Or if installed from source:

MXNet commit hash (git rev-parse HEAD):
5918bd1

If you are using python package, please provide

Python version and distribution:

If you are using R package, please provide

R sessionInfo():

Error Message:

Please paste the full error message, including stack trace.

Minimum reproducible example

if you are using your own code, please provide a short script that reproduces the error.

Steps to reproduce

or if you are running standard examples, please provide the commands you have run that lead to the error.

  1. set USE_CPP_PACKAGE = 1 in config.mk or set USE_CPP_PACKAGE to ON in CMakeLists.txt
  2. make
  3. build/cpp-package/example/lenet

What have you tried to solve it?

  1. Checked problem in debugger.

Stack is:

args_map["data"] = data_array.Slice(0, batch_size).Copy(ctx_dev);

->

inline NDArray NDArray::Slice(mx_uint begin, mx_uint end) const { // begin: 0, end: 42
NDArrayHandle handle;
CHECK_EQ(MXNDArraySlice(GetHandle(), begin, end, &handle), 0);

->

int MXNDArraySlice(NDArrayHandle handle,
mx_uint slice_begin,
mx_uint slice_end,
NDArrayHandle *out) {
NDArray *ptr = new NDArray();
API_BEGIN();
ptr = static_cast<NDArray>(handle)->Slice(
slice_begin, slice_end);

->

inline NDArray Slice(index_t begin, index_t end) const {
NDArray ret = *this;
CHECK(!is_none()) << "NDArray is not initialized";
CHECK_GE(shape_[0], end) << "Slice end index out of range";
size_t length = shape_.ProdShape(1, shape_.ndim());
ret.offset_ += begin * length;
ret.shape_[0] = end - begin;
return ret;
}

The "CHECK_GE" assertion fires. slice = { 0, 1, 28, 28}

@cjolivier01
Copy link
Member Author

I think mxnet-cpp/ndarray.hpp may be out of date with mxnet ndarray?

@yajiedesign
Copy link
Contributor

This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!

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

2 participants