前提・実現したいこと
chainerのサンプルプログラムとして提供されているTextClassifierクラスなどを活用できるようにしたい。
発生している問題・エラーメッセージ
github内のサンプルプログラムにアクセス
ImportError: cannot import name 'convert_seq'
該当のソースコード
python
1import chainer 2import chainer.functions as f 3import chainer.links as L 4import numpy as np 5import pandas as pd 6import MeCab 7from chainer import training 8from chainer.training import extensions 9import nets 10from nlp_utils import convert_seq, transform_to_array
試したこと
Windows cmdにおいて
pip install chainer
git clone https://github.com/chainer/chainer.git
set PYTHONPATH=chainer/examples/text_classification/
により、gitのリポジトリをクローンしてきた後、上記でインポートしているnetsやnlp_utilsが格納された場所へパスを通しているのですが、その中のクラスを引っ張ってくることが出来ません。
githubのコードをコピー&ペーストで無理やり解決してしまいましたが、結局上記の問題をどうすれば解決できるかがわかりません。
補足情報(FW/ツールのバージョンなど)
Python 3.6.5
chainer 6.2.0
回答1件
あなたの回答
tips
プレビュー