您当前的位置:首页 > IT编程 > 深度学习
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch |

自学教程:深度学习经典模型代码大全

51自学网 2020-11-29 09:45:16
  深度学习
这篇教程深度学习经典模型代码大全写得很实用,希望能帮到您。
https://github.com/rwightman/pytorch-image-models
convert
Add working Gluon Xception-65 model. Some cleanup still needed.
16 months ago
docs
Update README.md and docs in prep for 0.3.0 PyPi release.
29 days ago
notebooks
ImageNet-1k vs ImageNet-v2 comparison
17 months ago
results
Update results csvs with latest run
last month
tests
Fix regression for pretrained classifier loading when using entrypt f…
last month
timm
ver 0.3.1
28 days ago
.gitattributes
Add .gitattributes
17 months ago
.gitignore
Implement Eca modules
10 months ago
LICENSE
Add Apache LICENSE file
2 years ago
MANIFEST.in
Fix pruned txt files not being installed during pip install
7 months ago
README.md
Update README.md
5 days ago
avg_checkpoints.py
Default to old checkpoint format for now, still want compatibility wi…
2 months ago
clean_checkpoint.py
Default to old checkpoint format for now, still want compatibility wi…
2 months ago
distributed_train.sh
Fix distributed train script
2 years ago
hubconf.py
Simpler approach to loading entrypoints in hubconf works properly
9 months ago
inference.py
don't forget this file
2 months ago
mkdocs.yml
Fix some documentation rendering issues
4 months ago
requirements-docs.txt
Fix some documentation rendering issues
4 months ago
requirements-sotabench.txt
Update requirements so PyTorch 1.4 is min, add separate sotabench req…
6 months ago
requirements.txt
Update requirements so PyTorch 1.4 is min, add separate sotabench req…
6 months ago
setup.py
Update setup.py
5 months ago
sotabench.py
Add ViT to sotabench
last month
sotabench_setup.sh
Add Adafactor and Adahessian optimizers, cleanup optimizer arg passin…
2 months ago
train.py
Add Adafactor and Adahessian optimizers, cleanup optimizer arg passin…
2 months ago
validate.py
test_time_pool would be set to a non-False value even if test-time po…
2 months ago

README.md

PyTorch Image Models, etc

What's New

Oct 30, 2020

  • Test with PyTorch 1.7 and fix a small top-n metric view vs reshape issue.
  • Convert newly added 224x224 Vision Transformer weights from official JAX repo. 81.8 top-1 for B/16, 83.1 L/16.
  • Support PyTorch 1.7 optimized, native SiLU (aka Swish) activation. Add mapping to 'silu' name, custom swish will eventually be deprecated.
  • Fix regression for loading pretrained classifier via direct model entrypoint functions. Didn't impact create_model() factory usage.
  • PyPi release @ 0.3.0 version!

Oct 26, 2020

  • Update Vision Transformer models to be compatible with official code release at https://github.com/google-research/vision_transformer
  • Add Vision Transformer weights (ImageNet-21k pretrain) for 384x384 base and large models converted from official jax impl
    • ViT-B/16 - 84.2
    • ViT-B/32 - 81.7
    • ViT-L/16 - 85.2
    • ViT-L/32 - 81.5

Oct 21, 2020

  • Weights added for Vision Transformer (ViT) models. 77.86 top-1 for 'small' and 79.35 for 'base'. Thanks to Christof for training the base model w/ lots of GPUs.

Oct 13, 2020

  • Initial impl of Vision Transformer models. Both patch and hybrid (CNN backbone) variants. Currently trying to train...
  • Adafactor and AdaHessian (FP32 only, no AMP) optimizers
  • EdgeTPU-M (efficientnet_em) model trained in PyTorch, 79.3 top-1
  • Pip release, doc updates pending a few more changes...

Sept 18, 2020

  • New ResNet 'D' weights. 72.7 (top-1) ResNet-18-D, 77.1 ResNet-34-D, 80.5 ResNet-50-D
  • Added a few untrained defs for other ResNet models (66D, 101D, 152D, 200/200D)

Sept 3, 2020

  • New weights
    • Wide-ResNet50 - 81.5 top-1 (vs 78.5 torchvision)
    • SEResNeXt50-32x4d - 81.3 top-1 (vs 79.1 cadene)
  • Support for native Torch AMP and channels_last memory format added to train/validate scripts (--channels-last--native-amp vs --apex-amp)
  • Models tested with channels_last on latest NGC 20.08 container. AdaptiveAvgPool in attn layers changed to mean((2,3)) to work around bug with NHWC kernel.

Aug 12, 2020

  • New/updated weights from training experiments
    • EfficientNet-B3 - 82.1 top-1 (vs 81.6 for official with AA and 81.9 for AdvProp)
    • RegNetY-3.2GF - 82.0 top-1 (78.9 from official ver)
    • CSPResNet50 - 79.6 top-1 (76.6 from official ver)
  • Add CutMix integrated w/ Mixup. See pull request for some usage examples
  • Some fixes for using pretrained weights with in_chans != 3 on several models.

Aug 5, 2020

Universal feature extraction, new models, new weights, new test sets.

  • All models support the features_only=True argument for create_model call to return a network that extracts feature maps from the deepest layer at each stride.
  • New models
    • CSPResNet, CSPResNeXt, CSPDarkNet, DarkNet
    • ReXNet
    • (Modified Aligned) Xception41/65/71 (a proper port of TF models)
  • New trained weights
    • SEResNet50 - 80.3 top-1
    • CSPDarkNet53 - 80.1 top-1
    • CSPResNeXt50 - 80.0 top-1
    • DPN68b - 79.2 top-1
    • EfficientNet-Lite0 (non-TF ver) - 75.5 (submitted by @hal-314)
  • Add 'real' labels for ImageNet and ImageNet-Renditions test set, see results/README.md
  • Test set ranking/top-n diff script by @KushajveerSingh
  • Train script and loader/transform tweaks to punch through more aug arguments
  • README and documentation overhaul. See initial (WIP) documentation at https://rwightman.github.io/pytorch-image-models/
  • adamp and sgdp optimizers added by @hellbell

June 11, 2020

Bunch of changes:

  • DenseNet models updated with memory efficient addition from torchvision (fixed a bug), blur pooling and deep stem additions
  • VoVNet V1 and V2 models added, 39 V2 variant (ese_vovnet_39b) trained to 79.3 top-1
  • Activation factory added along with new activations:
    • select act at model creation time for more flexibility in using activations compatible with scripting or tracing (ONNX export)
    • hard_mish (experimental) added with memory-efficient grad, along with ME hard_swish
    • context mgr for setting exportable/scriptable/no_jit states
  • Norm + Activation combo layers added with initial trial support in DenseNet and VoVNet along with impl of EvoNorm and InplaceAbn wrapper that fit the interface
  • Torchscript works for all but two of the model types as long as using Pytorch 1.5+, tests added for this
  • Some import cleanup and classifier reset changes, all models will have classifier reset to nn.Identity on reset_classifer(0) call
  • Prep for 0.1.28 pip release

May 12, 2020

May 3, 2020

May 1, 2020

  • Merged a number of execellent contributions in the ResNet model family over the past month
    • BlurPool2D and resnetblur models initiated by Chris Ha, I trained resnetblur50 to 79.3.
    • TResNet models and SpaceToDepth, AntiAliasDownsampleLayer layers by mrT23
    • ecaresnet (50d, 101d, light) models and two pruned variants using pruning as per (https://arxiv.org/abs/2002.08258) by Yonathan Aflalo
  • 200 pretrained models in total now with updated results csv in results folder

April 5, 2020

  • Add some newly trained MobileNet-V2 models trained with latest h-params, rand augment. They compare quite favourably to EfficientNet-Lite
    • 3.5M param MobileNet-V2 100 @ 73%
    • 4.5M param MobileNet-V2 110d @ 75%
    • 6.1M param MobileNet-V2 140 @ 76.5%
    • 5.8M param MobileNet-V2 120d @ 77.3%

March 18, 2020

  • Add EfficientNet-Lite models w/ weights ported from Tensorflow TPU
  • Add RandAugment trained ResNeXt-50 32x4d weights with 79.8 top-1. Trained by Andrew Lavin (see Training section for hparams)

Introduction

PyTorch Image Models (timm) is a collection of image models, layers, utilities, optimizers, schedulers, data-loaders / augmentations, and reference training / validation scripts that aim to pull together a wide variety of SOTA models with ability to reproduce ImageNet training results.

The work of many others is present here. I've tried to make sure all source material is acknowledged via links to github, arxiv papers, etc in the README, documentation, and code docstrings. Please let me know if I missed anything.

Models

All model architecture families include variants with pretrained weights. The are variants without any weights. Help training new or better weights is always appreciated. Here are some example training hparams to get you started.

A full version of the list below with source links can be found in the documentation.

Features

Several (less common) features that I often utilize in my projects are included. Many of their additions are the reason why I maintain my own set of models, instead of using others' via PIP:

Results

Model validation results can be found in the documentation and in the results tables

Getting Started

See the documentation

Train, Validation, Inference Scripts

The root folder of the repository contains reference train, validation, and inference scripts that work with the included models and other features of this repository. They are adaptable for other datasets and use cases with a little hacking. See documentation for some basics and training hparams for some train examples that produce SOTA ImageNet results.

Awesome PyTorch Resources

One of the greatest assets of PyTorch is the community and their contributions. A few of my favourite resources that pair well with the models and componenets here are listed below.

Training / Frameworks

Computer Vision / Image Augmentation

Metric Learning

Object Detection, Instance and Semantic Segmentation

Licenses

Code

The code here is licensed Apache 2.0. I've taken care to make sure any third party code included or adapted has compatible (permissive) licenses such as MIT, BSD, etc. I've made an effort to avoid any GPL / LGPL conflicts. That said, it is your responsibility to ensure you comply with license here and conditions of any dependent licenses. Where applicable, I've linked the sources/references for various components in docstrings. If you think I've missed anything please create an issue.

Pretrained Weights

So far all of the pretrained weights available here are pretrained on ImageNet with a select few that have some additional pretraining (see extra note below). ImageNet was released for non-commercial research purposes only (http://www.image-net.org/download-faq). It's not clear what the implications of that are for the use of pretrained weights from that dataset. Any models I have trained with ImageNet are done for research purposes and one should assume that the original dataset license applies to the weights. It's best to seek legal advice if you intend to use the pretrained weights in a commercial product.

Pretrained on more than ImageNet

Several weights included or references here were pretrained with proprietary datasets that I do not have access to. These include the Facebook WSL, SSL, SWSL ResNe(Xt) and the Google Noisy Student EfficientNet models. The Facebook models have an explicit non-commercial license (CC-BY-NC 4.0, https://github.com/facebookresearch/semi-supervised-ImageNet1K-modelshttps://github.com/facebookresearch/WSL-Images). The Google models do not appear to have any restriction beyond the Apache 2.0 license (and ImageNet concerns). In either case, you should contact Facebook or Google with any questions.


神经网络训练loss不下降原因各种情况分析与解决办法
本地MNIST数据集读取(最清晰、最实用)代码
51自学网,即我要自学网,自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1