Giter VIP home page Giter VIP logo

pytorch-best-practice's Introduction

PyTorch 实践指南

本文是文章PyTorch实践指南配套代码,请参照知乎专栏原文或者对应的markdown文件更好的了解而文件组织和代码细节。

本部分内容属于 《深度学习框架PyTorch:入门与实践》一部分, 关于该书的源码,以及更多案例,请查看github

数据下载

  • kaggle比赛官网 下载所需的数据
  • 解压并把训练集和测试集分别放在一个文件夹中

安装

  • PyTorch : 可按照PyTorch官网的指南,根据自己的平台安装指定的版本
  • 安装指定依赖:
pip install -r requirements.txt

训练

必须首先启动visdom:

python -m visdom.server

然后使用如下命令启动训练:

# 在gpu0上训练,并把可视化结果保存在visdom 的classifier env上
python main.py train --data-root=./data/train --use-gpu=True --env=classifier

详细的使用命令 可使用

python main.py help

测试

python main.py --data-root=./data/test --use-gpu=False --batch-size=256

pytorch-best-practice's People

Contributors

chenyuntc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.