Giter VIP home page Giter VIP logo

classification-template's Introduction

图像分类任务模板

使用torchnet模板和tensorboard可视化分类模板。

models文件夹下为模型,对于自定义的模型,需要将模型写入models/__init__.py文件中才能在main.py中使用。

Usage

clone该Repository

git clone [email protected]:JunLab-Hitsz/Classification-Template.git
cd Classification-Template

Install Requirements

pip install -r requirements.txt

Start Training

直接使用launch.sh脚本启动训练,传入gpu编号即可

$ ./launch.sh 0

或者使用如下命令,如下命令可以修改main.py中的parser参数

$ CUDA_VISIBLE_DEVICES=0 python main.py --dataset mnist

Tensorboard

在命令行下可以直接运行以下代码启动Tensorboard

tensorboard --logdir=/path/to/tensorboard/log

修改以上logdir,该Repository的logdir为当前文件夹。

如果在docker中训练,由于端口可能无法看到tensorboard的结果,这里推荐使用VSCode来启动tensorboard

VSCode with Tensorboard

由于代码中存在Tensorboard的代码,VSCode会提示安装Tensorboard,安装完成后使用Shift+Ctrl+p打开VSCode菜单,输入launch tensorboard,随后选择logdir即可。此时VSCode下方控制台port栏会出现端口映射,鼠标点击即可访问tensorboard可视化结果。 图片

Reference

https://github.com/gram-ai/capsule-networks

TODO

当前版本为单卡训练版本,多卡还没实现。

目标检测任务可以使用MMdetection框架,该框架基于Pytorch实现。

classification-template's People

Contributors

junlab-hitsz avatar

Watchers

 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.