Code Monkey home page Code Monkey logo

gluon-fashionai-attributes's Introduction

Gluon-FashionAI-Attributes

这是为阿里天池竞赛——服饰属性标签识别提供的gluon教程与benchmark代码。

gluon教程会从零开始一步步讲解,带你上手此次竞赛,同时也能帮助理解benchmark代码。

当前benchmark代码

  • 在初赛数据集上能达到大约0.95的mAP与0.84的准确率,同时还有很大的提升空间。
  • 在4块Tesla V100以及32核CPU的 AWS p3.8xlarge 机器上的总运行时间约为2.5小时。

重现benchmark步骤:

  1. 前往比赛官网,登录并注册参赛后可在左边“赛题与数据”标签内下载数据。之后将数据解压到data/文件夹中。解压后的目录结构应该如下所示:
Gluon-FashionAI-Attributes
├── benchmark.sh
├── data
│   ├── base
│   ├── rank
│   └── web
├── FashionAI-Attributes-Skirt.ipynb
├── prepare_data.py
├── README.md
└── train_task.py
  1. 参考FashionAI-Attributes-Skirt.ipynb中的环境配置一节配置教程
  2. 根据具体运行环境设置benchmark.sh中的变量
  • num_gpus,即GPU的个数,设置为0即为只用CPU训练。
  • num_workers,即用来处理数据的进程个数,建议设置为CPU核心个数。
  1. 运行bash benchmark.sh,这个脚本会自动准备数据,针对每个任务训练模型并预测,以及最后的合并预测。
  2. 运行结束后,将submission/submission.csv压缩成zip格式并通过官网左侧的“提交结果”标签页提交。

保存/读取模型文件

在参加比赛时,选手们常常会训练多个模型,有时也需要保存模型留作以后使用。

如果要保存模型,可以在训练过程中使用

finetune_net.save_params('filename.params')

命令来实现。在读取时,可以通过

net = gluon.model_zoo.vision.get_model(model_name)
with net.name_scope():
    net.output = nn.Dense(task_num_class)
net.load_params('filename.params', ctx=mx.gpu())

来导入模型文件。

吐槽和讨论请点这里

gluon-fashionai-attributes's People

Contributors

hetong007 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.