clab / clab/dynet

MNIST Example Error

Open
#1,183 0 comments 0 reactions 0 assignees View on GitHub
minor bug
Dominant language
C++
Stars
3.4k
Forks
701
PR merge metrics
No merged PRs in 30d

Description

I installed DyNet manually for C++ (and set it up for python) with the following ```cmake .. -DEIGEN3_INCLUDE_DIR=../../eigen -DPYTHON=`which python3` -DBACKEND=eigen -DMKL=True -DMKL_ROOT=/opt/intel/mkl -DENABLE_CPP_EXAMPLES=ON```

I tried running the compiled examples (xor and the rnnlm worked) but when I ran the mnist example I got this error
```
mnist: /usr/local/src/dynet-base/eigen/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h:392: Eigen::TensorEvaluator, Device>::TensorEvaluator(const XprType&, const Device&) [with BinaryOp = Eigen::internal::scalar_product_op; LeftArgType = const Eigen::TensorConversionOp > > >; RightArgType = const Eigen::TensorMap >; Device = Eigen::DefaultDevice; Eigen::TensorEvaluator, Device>::XprType = Eigen::TensorCwiseBinaryOp, const Eigen::TensorConversionOp > > >, const Eigen::TensorMap > >]: Assertion `dimensions_match(m_leftImpl.dimensions(), m_rightImpl.dimensions())' failed.
Aborted (core dumped)
```
I added some prints to the examples and the error seems to come from the `cg.backward(loss_expr);` line.

I am using Ubuntu 16.04 and compiled with g++ 5.4

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the MNIST example using the reported CMake options on Ubuntu 16.04 with g++ 5.4. Start at the cg.backward(loss_expr) call and inspect the Eigen TensorEvaluator assertion for mismatched dimensions. Done means the MNIST example completes without aborting.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.