Python,Tensorflow

Thumbnail of post image 109

pip install tensorflow

を実行した際,

ERROR: Could not find a version that satisfies the requirement tensorflow

Flair,Optuna,Python

Thumbnail of post image 050

とある仕事で,固有表現抽出器の性能をぎりぎりまで向上させる必要があったため,自作のコーパスに対してFlairでNERを学習し,Optunaでハイパーパラメータチューニングを行なった.本記事ではそのときのコードを示す.

Em ...

PyTorch

Thumbnail of post image 145

Pytorchで学習したモデルを保存する時は

torch.save(model.state_dict(), model_path)

でモデルを保存することが推奨される.

state_dictがsaveで直接保存す ...

Python,PyTorch

Thumbnail of post image 031

Pytorchを使っている時に出たエラー.これがでたときには,モデルの読み込みの順番でエラーが発生していることが多い.少し順番を変えてあげればケロっとエラーが解消されることが多い.

よくあるエラーが,.load_state ...

Python

Thumbnail of post image 141

エラー

ModuleNotFoundError: No module named ‘flair.embeddings.token’; ‘flair.embeddings’ i ...

Python

Thumbnail of post image 081

スクリプトに一行挿入する.この場合,変数hogeに括弧内以外の文字列が入っているときにエラーをだす.

assert hoge in ("hogeA", "hogeB", "hogeC")

Python

Thumbnail of post image 172

個人的に,入出力をdocoptを記述し,コンフィグ情報はyamlを使って引数として取り込むのが好きなので,そのスクリプトについてメモしておく.decoptの記述では,空行を設けることが重要なので,必要以上に詰めて書かないこと. ...

ELECTRA,Google Cloud Platform,Tensorflow

Thumbnail of post image 190

GCP経由でTPUを利用することによって,ELECTRAの事前学習を実行する方法を紹介.

必要なサービスCompute Engine
Cloud TPU
Cloud Storage
手順Cloud Shell ...

Google Cloud Platform

Thumbnail of post image 020

前提条件既にGoogle Cloud Platformでプロジェクトを作成されていること
AWS S3にアクセスするためのセキュリティキーをもっていること
設定ファイルの生成と編集

まずは以下のコマンドでオプション変更を行う ...

Google Cloud Platform

Thumbnail of post image 006

GCPでインスタンスをたてるまでの手順を紹介.

Compute Engineでインスタンスの作成

Compute EngineはAWSでいうところのEC2インスタンスにあたり,機械学習のアプリケーションを動かすためのサーバー ...