0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Pythia Instllation

Posted at

はじめに

Facebook AI Researchが公開しているマルチモーダルな深層学習モデルのフレームワークPythiaを自分がインストールしたときの方法を残します。
いろいろとひっかかり友人に聞いたりして結果的に動かせた流れなので、適切ではないのかもしれません。

Introduce how to install Pythia which is Framework of Multimodal AI models from Facebook AI Research.

コンテナ準備 Create Docker Contena

まず、下記のDockerfileをビルドしてコンテナを作成します。

First, creating Docker contena using following Dockerfile.

そのコンテナ内でPythia's DocumentationのQuickstartにあるColoabのデモコードを参考にインストール作業をしていきます。

Let's install Pythia according to the Documentation. Follow the code of Quickstart Colab file.

Installation

terminalで以下のコードを順に実行していきます。

Run following codes on terminal.

cd
mkdir content

# Install dependencies
pip install ninja yacs cython matplotlib demjson
pip install git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI
cd ~/content/
rm -rf fastText
git clone https://github.com/facebookresearch/fastText.git fastText
cd /content/fastText
pip install -e .
cd ~/content/
rm -rf pythia
git clone https://github.com/facebookresearch/pythia.git pythia
cd /content/pythia

# Don't modify torch version
sed -i '/torch/d' requirements.txt
pip install -e .

以下を.bashrcに追加

Add the next PATH to bashrc.

PATH="$PATH":~/content/pythia
# Install maskrcnn-benchmark to extract detectron features
cd /content
git clone https://gitlab.com/meetshah1995/vqa-maskrcnn-benchmark.git
cd /content/vqa-maskrcnn-benchmark
# Compile custom layers and build mask-rcnn backbone
python setup.py build
python setup.py develop

以下を.bashrcに追加
Add the next PATH to bashrc.

PATH="$PATH":~/content/vqa-maskrcnn-benchmark

また、自分は保険でpythia dirで以下を実行

python setup.py develop

これをすると次のようなエラーが返ってきます
If run the above code, following error may return.

error: tqdm 4.19.9 is installed but tqdm>=4.27 is required by {'transformers'}

しかしPythiaはインストールできているようなので手作業でtransformersを入れます。
Transformers lib requires tqdm>=4.27 , so you should update tqdm and install transformers manually using pip.

pip install -U tqdm
pip install transformers

これでtransformersは使えるようになりました。
Then you can use (it means import) transformers.

以上でInstallionは完了です。以降は使ってみた様子を残していこうと思います。
Instllation of Pythia is finished.
From now on, I'll record how I used it.

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?