0
0

Transformer実装

Last updated at Posted at 2024-01-21

Tensor2Tensor

無理だった。

$ pip3 install tensorflow-gpu==2.1.0
# GPU対応のTensorflow

$ pip3 uninstall tensorflow-addons
$ pip3 install tensorflow-addons==0.9.1

$ t2t-datagen --data_dir=data/data1 --tmp_dir=tmp --problem=translate_jpen --t2t_usr_dir .

$ t2t-trainer --data_dir=data/data1 --problem=translate_jpen --model=transformer --hparams_set=transformer_base_single_gpu --output_dir=training_result1 --t2t_usr_dir=.

Harvard

GPUを4つ使うので、G.largeを借りる。

qrsh -g gcc50582 -l rt_G.large=1 -l h_rt=01:00:00
$ pip3 install torchtext spacy
# Error: python setup.py egg_info error code 1

pip gradeupできれば万事解決できそうだけど残念ながらできないので…

やらなくていい!
$ pip3 install cython --user
$ git clone https://github.com/explosion/spaCy
$ cd spaCy

$ pip3 install -r Translation/spaCy/requirements.txt --user
$ python Translation/spaCy/setup.py build_ext --inplace

できた!!!!!!歓喜の舞!!!!!!!

こっち!
$ pip3 install --user --upgrade pip
$ pip3 install torchtext spacy --user
はじめに入れるもの
$ pip3 install http://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp36-cp36m-linux_x86_64.whl numpy matplotlib spacy torchtext seaborn --user
$ pip3 install matplotlib --user
$ pip3 install seaborn --user
$ pip3 install torchtext --user

# Translation-Task
$ pip3 install torchtext spacy --user
$ python3 -m spacy download en --user
$ python3 -m spacy download de --user
setup.py
# 125行目
def write_git_info_py(filename="spacy/git_info.py"):
# 書き換え
def write_git_info_py(filename="Translation/spaCy/spacy/git_info.py")
batch.py
# import の下に追記
warnings.simplefilter('ignore')
# 警告の非表示

データPATH

/home/acc12954dm/.local/lib/python3.6/site-packages/spacy/data/de

参考文献

モデル

今後?

エラー対処

技術

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0