LoginSignup
0
1

More than 3 years have passed since last update.

Skip GANomalyをHello World!(Windows, Anaconda, PyTorch)

Last updated at Posted at 2021-01-30

1 目的

Skip GANomalyをローカルPCで動かす
引用元リポジトリ[1]

2 環境

OS: Windows 10
GPU: 無し
環境: conda

3 構築の流れ

3.1 クローン

   git clone https://github.com/samet-akcay/skip-ganomaly.git

3.2 conda環境作成

    conda create -n skipganomaly python=3.7

3.3 作成した環境をactivate

    conda activate skipganomaly

3.4 PyTorchをインストール

PyTorchの公式サイトより、torch v1.2.0をインストールする。PyTorchの過去のバージョン

# CPU only
pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

3.5 requirements.txtの編集

インストールしたPyTorchのverに合わせて編集

requirements.txt
- torchvision==0.4.2
+ torchvision==0.4.0

3.6 各ライブラリのインストール

   pip install --user --requirement requirements.txt

4 動作確認

CIFAR10で動作確認する
はじめに可視化ツールVisdomを起動

python -m visdom.server

学習を実行

python train.py --dataset cifar10 --niter 5 --abnormal_class automobile --display --device cpu --gpu_ids -1

結果をvisdomで確認できる。
visdomはブラウザで (http://localhost:8097/) へアクセス
入力画像(Reals)に近しい画像が生成(Fakes)されていることが確認できる
image.png

5 次稿

次稿でオリジナルのデータセットによる異常検知を試す

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