1
1

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.

AIを実装するデファクトスタンダード2021、インストール編

Last updated at Posted at 2021-05-15

この記事の内容

AI、機械学習をウェブ上に実装するときにどういう技術を使えば良いかわからないときに自分ならこういう構成にするという記事を書きます。
ひとによって技術的な観点が異なるので、もしかしたら全然違う人もいるかもしれませんが、ご了承ください。
サンプルアプリケーションとして文章の末尾に絵文字を付けるアプリケーションを作成します。

完成イメージ

この記事で使う技術

  • PyTorch
  • FastAPI
  • Next.js(React.js)
  • TailwindCSS
  • Docker
  • Kubernetes
  • MLFlow
  • ElasticSearch
  • Azure

インストール

Pythonの環境の構築は省略します。
PyTorchのインストールにはPoetryを使用します。これは依存環境を自動的に作ってくれるソフトウェアです。

Poetryのインストール方法

Pythonの実行環境の構築

poetry new emoji_app

ディレクトリ構造

tree emoji_app/
# output
emoji_app/
├── README.rst
├── emoji_app
│   └── __init__.py
├── pyproject.toml
└── tests
    ├── __init__.py
    └── test_emoji_app.py

また、以下の環境の構築用の設定ファイルが生成されます。

[tool.poetry]
name = "emoji_app"
version = "0.1.0"
description = ""
authors = ["oshita-n <*******@*******>"]

[tool.poetry.dependencies]
python = "^3.7"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Poetryの準備ができたらPyTorchをインストールします。

poetry add torch

次に今回APIの作成に利用するfastapiをインストールします。

poetry add fastapi

おつかれさまでした。これでPythonに関するソフトウェアのインストールは終了です。
次回はAIモデルを作成します。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?