Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynet安装 #1

Open
chaoli1024 opened this issue Dec 13, 2017 · 4 comments
Open

dynet安装 #1

chaoli1024 opened this issue Dec 13, 2017 · 4 comments
Labels

Comments

@chaoli1024
Copy link

按照dynet教程在Linux和Windows安装不上,您是如何安装的,还是在服务器上运行的

@hankcs
Copy link
Owner

hankcs commented Dec 13, 2017

我是从源码编译安装的,第一步先安装mkl(可选,大幅提升CPU速度):
http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/11544/l_mkl_2017.3.196.tgz

然后执行如下命令:

#!/usr/bin/env bash

git clone https://github.com/clab/dynet.git
hg clone https://bitbucket.org/eigen/eigen -r 346ecdb  # -r NUM specified a known working revision
cd dynet
git checkout 2.0.1
mkdir build
cd build
cmake .. -DEIGEN3_INCLUDE_DIR=../../eigen -DMKL=TRUE -DPYTHON=`which python3` -DMKL_ROOT=/opt/intel/mkl
make -j 4
cd python
python ../../setup.py build --build-dir=.. --skip-build install

@chaoli1024
Copy link
Author

chaoli1024 commented Jan 5, 2018

`Traceback (most recent call last):

File "model.py", line 528, in
loss_expr = model.neg_log_loss(instance.sentence, instance.tags)

File "model.py", line 192, in neg_log_loss
forward_score = self.forward(observations)

File "model.py", line 212, in forward
alphas_t.append(log_sum_exp(next_tag_expr))

File "model.py", line 202, in log_sum_exp
return max_score_expr + dy.log(dy.sum_cols(dy.transpose(dy.exp(scores - max_score_expr_broadcast))))

AttributeError: module 'dynet' has no attribute 'sum_cols'`

@hankcs
Copy link
Owner

hankcs commented Jan 5, 2018

Dynet版本号不匹配,必须是2.0.1:https://github.com/clab/dynet/releases/tag/2.0.1

@liyuxi1110
Copy link

请问在执行make -j 4这个命令时
报错No targets specified and no makefile found.会是什么原因呢?
我在build目录下没有找到makefile文件,是需要自己写吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants