火把的预训练模型

pretrainedmodels的Python项目详细描述


#Pythorch的预训练模型(正在进行中)

本报告的目标是:

-帮助复制研究论文结果(例如传输学习设置),
-访问具有独特接口的预训练ConvNet/API,灵感来自TorchVision。

<;a href="https://travis ci.org/cadene/pretrained models.pytorch">;<;img src="https://api.travis-ci.org/cadene/pretrained-models.pytorch.svg?branch=master"/>;
news:
-27/10/2018:修复兼容性问题,添加测试,添加travis
-04/06/2018:[polynet](https://github.com/cuhk-mmlab/polynet)和[pnasnet-5-large](https://arxiv.org/abs/1712.00559)感谢[alex parinov](https://github.com/creafz)
-16/04/2018:[se resnet*和se resnext*](https://github.com/hujie-frank/senet)感谢[alex帕里诺夫](https://github.com/creafz)
-2018年4月9日:[senet154](https://github.com/hujie-frank/senet)感谢[alex parinov](https://github.com/creafz)
-22/03/2018:cafferesnet101(很适合使用fasterrcnn进行本地化)
-21/03/2018:nasnet mobile感谢[veronikaYurchuk(https://github.com/veronikayurchuk)和[anastasiia](https://github.com/dagnyt)
-25/01/2018:双路径网络感谢[ross wightman](https://github.com/rwightman/pytorch dpn pretrained),异常感谢[t standley](https://github.com/tstandley/xception pytorch),改进的transformimage api
-13/01/2018:`pip install pretrainedmodels`,`pretrainedmodels.model\u names`,`pretrainedmodels.pretrained\u settings`
-12/01/2018:`python setup.py install`
-08/12/2017:更新数据url(/!\`需要git pull)
-30/11/2017:改进api(`model.features(input)`,`model.logits(features)`,`model.forward(input)`,` model.last_linear`)
-16/11/2017:t.durand和r.cadene移植的nasnet-a-大型预训练模型
-22/07/2017:torchvision预训练模型
-22/07/2017:inceptionv4和inceptionresnetv2的动量为0.1
-17/07/2017:model.input_range attribution
-17/07/2017:binception在ImageNet上预先训练

摘要

-[安装](https://github.com/cadene/pretrained models.pytorch安装)
-[快速示例](https://github.com/cadene/pretrained models.pytorch快速示例)
-[很少使用案例](https://github.com/cadene/pretrained models.pytorch很少使用案例)
-[计算ImageNet登录](https://github.com/cadene/pretrained models.pytorch计算ImageNet登录)
-[计算ImageNet验证指标](https://github.com/cadene/pretrained models.pytorch compute imagenet validation metrics)
-[对imagenet的评估](https://github.com/cadene/pretrained models.pytorch对imagenet的评估)
-[准确性valset](https://github.com/cadene/pretrained models.pytorch验证集的准确性)
-[复制结果](https://github.com/cadene/pretrained models.pytorch复制结果)
-[文档](https://github.com/cadene/pretrained models.pytorch文档)
-[可用模型](https://github.com/cadene/pretrained models.pytorch可用模型)
-[alexnet](https://github.com/cadene/pretrained models.pytorch torchvision)
-[binception](https://github.com/cadene/pretrained models.pytorch binception)
-[cafferesnet101](https://github.com/cadene/pretrained models.pytorch caffe resnet)
-[densenet121](https://github.com/cadene/pretrained models.pytorch torchvision)
-[densenet161](https://github.com/cadene/pretrained models.pytorch torchvision)
-[邓森et169](https://github.com/cadene/pretrained models.pytorch torchvision)
-[邓森et201](https://github.com/cadene/pretrained models.pytorch torchvision)
-[邓森et201](https://github.com/cadene/pretrained models.pytorch torchvision)
-[双路径网68](https://github.com/cadene/pretrained models.pytorch双路径网)
-[双路径网92](https://github.com/cadene/pretrained models.pytorch dualpathnetworks)
-[dualpathnet98](https://github.com/cadene/pretrained models.pytorch dualpathnetworks)
-[dualpathnet107](https://github.com/cadene/pretrained models.pytorch dualpathnetworks)
-[DualPathNet113](https://github.com/cadene/pretrained models.pytorch dualPathNetworks)
-[fbresnet152](https://github.com/cadene/pretrained models.pytorch facebook resnet)
-[inceptionresnetv2](https://github.com/cadene/pretrained models.pytorch inception)
-[激励v3](https://github.com/cadene/pretrained models.pytorch inception)
-[激励v4](https://github.com/cadene/pretrained models.pytorch inception)
-[nasnet-a-large](https://github.com/cadene/pretrained models.pytorch nasnet)
-[NASNET-A-Mobile](https://github.com/cadene/pretrained models.pytorch NASNET)
-[pnasnet-5-large](https://github.com/cadene/pretrained models.pytorch pnasnet)
-[polynet](https://github.com/cadene/pretrained models.pytorch polynet)
-[resnext101 x4d](https://github.com/cadene/pretrained models.pytorch resnext)
-[resnext101 x4d](https://github.com/cadene/pretrained models.pytorch resnext)
-[resnet101](https://github.com/cadene/pretrained models.pytorch torchvision)
-[resnet152](https://github.com/cadene/pretrained models.pytorch torchvision)
-[resnet18](https://github.com/cadene/pretrained models.pytorch torchvision)
-[resnet34](https://github.com/cadene/pretrained models.pytorch torchvision)
-[resnet50](https://github.com/cadene/pretrained models.pytorch torchvision)
-[senet154](https://github.com/cadene/pretrained models.pytorch senet)
-[se-resnet50](https://github.com/cadene/pretrained models.pytorch senet)
-[SE-Resnet101](https://github.com/cadene/pretrained models.pytorch senet)
-[SE-resnet152](https://github.com/cadene/pretrained models.pytorch senet)
-[SE-resnext50 u 32x4d](https://github.com/cadene/pretrained models.pytorch senet)
-[SE-resnext101 x4d](https://github.com/cadene/pretrained models.pytorch senet)
-[squezenet1_0](https://github.com/cadene/pretrained models.pytorch torchvision)
-[squezenet1_1](https://github.com/cadene/pretrained models.pytorch torchvision)
-[vgg11](https://github.com/cadene/pretrained models.pytorch torchvision)
-[vgg13](https://github.com/cadene/pretrained models.pytorch torchvision)
-[vgg16](https://github.com/cadene/pretrained models.pytorch torchvision)
-[vgg19](https://github.com/cadene/pretrained models.pytorch torchvision)
-[vgg11 bn](https://github.com/cadene/pretrained models.pytorch torchvision)
-[vgg13 bn](https://github.com/cadene/pretrained models.pytorch torchvision)
-[vgg16-bn](https://github.com/cadene/pretrained models.pytorch torchvision)
-[vgg19-bn](https://github.com/cadene/pretrained models.pytorch torchvision)
-[xception](https://github.com/cadene/pretrained models.pytorch xception)
-[型号api](https://github.com/cadene/pretrained models.pytorch model api)
-[模型输入大小](https://github.com/cadene/pretrained models.pytorch model输入大小)
-[模型输入空间](https://github.com/cadene/pretrained models.pytorch model输入空间)
-[型号.输入范围](https://github.com/cadene/pretrained models.pytorch型号输入范围)
-[型号.平均值](https://github.com/cadene/pretrained models.pytorch modelmane)
-[型号.标准](https://github.com/cadene/pretrained models.pytorch model std)
-[模型.功能](https://github.com/cadene/pretrained models.pytorch模型功能)
-[模型.登录](https://github.com/cadene/pre训练模型。pytorch modellogits)
-[模型.转发](https://github.com/cadene/pretrained models.pytorch model forward)
-[复制移植](https://github.com/cadene/pretrained models.pytorch复制)
-[resnet*](https://github.com/cadene/pretrained models.pytorch hand-porting-of-resnet152)
-[resnext*](https://github.com/cadene/pretrained models.pytorch resnext的自动移植)
-[inception*](https://github.com/cadene/pretrained models.pytorch hand-porting-of-inceptionv4-and-inceptionresnetv2)

[蟒蛇3号](https://www.continuum.io/downloads)
2.[带/不带CUDA的Pythorch](http://pytorch.org)


` pip从repo安装pretrainedmodels`


` git克隆https://github.com/cadene/pretrained models.pytorch.git`
4.` CD预处理模型。Pythorch`
5.` python setup.py install`


快速示例

-导入"pretrained models":

``python
``import pretrainedmodels
````

-打印可用的pretrained模型:

``python
打印(pretrainedmodels.model\u names)
>;['fbresnet152',"binception"、"resnext101_32x4d"、"resnext101_64x4d"、"inceptionv4"、"inceptionresnetv2"、"alexnet"、"densenet121"、"densenet169"、"densenet201"、"densenet161"、"resnet18"、"resnet34"、"resnet50"、"resnet101"、"resnet152"、"inceptionv3"、"squenet1_0"、"squenet1_1"、"vgg11"、"vgg11_bn","vgg13"、"vgg13-bn"、"vgg16"、"vgg16-bn"、"vgg19-bn"、"vgg19"、"nasnetalage"、"nasnetambile"、"cafferesnet101"、"senet154"、"se-resnet50"、"se-resnet101"、"se-resnet152"、"se-resnext50-u32x4d"、"se-resnext101-u32x4d"、"cafferesnet101"、"polynet","pnasnet5large"]
```

-要打印所选模型的可用预训练设置:

``python
打印(预训练模型。预训练设置['nasnetalage'])
>;{'imagenet':{'url':'http://data.lip6.fr/cadene/pretrainedmodels/nasnetalage-a1897284.pth','input撸space':"rgb","输入大小":[331,331],"输入范围":[0,1],"平均值":[0.5,0.5,0.5],"标准值":[0.5,0.5,0.5],"数值类":1000},"图像网+背景":{'url':"http://data.lip6.fr/cadene/pretrainedmodels/nasnetalage-a1897284.pth","输入空间":"rgb","输入大小":[3,331,331],'输入范围':[0,1],'平均值':[0.5,0.5,0.5],'标准值':[0.5,0.5,0.5],"num-classes":1001}
```

-要从ImageNet加载预训练模型:

```python
model\name='nasnetalage';可以是fbresnet152或inceptionresnetv2
model=pretrained models.[model\u name](num-classes=1000,pretrained="imagenet")
model.eval()
```

**注意**:默认情况下,模型将下载到您的`$home/.torch'文件夹。您可以使用`$torch_model_zoo`变量修改此行为,如下所示:`export torch_model_zoo!'/local/pretrainedmodels`

-加载图像并执行完整的转发过程:

``python
import torch
import pretrainedmodels.utils as utils

load_img=utils.loadimage()

#3x400x225->;3x299x299大小可能不同
需要_grad=false)

output_logits=model(input)1x1000
````

-提取功能(注意,此API不适用于所有网络):

``python
output_features=model.features(input)1x14x2048大小可能不同=model.logits(output_features)1x1000
```


(https://github.com/cadene/pretrained-models.pytorch/blob/master/examples/imagenet_logits.py)使用imagenet上的预训练模型计算单个映像上类外观的登录名。

``````
$python examples/imagenet_logits.py-h
>;nasnetalage,resnet152,inceptionresnetv2,inceptionv4,…
```

```
$python examples/imagenet_logits.py-a nasnetalage--path_img data/cat.png
>;"nasnetalage":data/cat.png是一只"老虎猫"
```


\compute imagenet evaluation metrics

-请参见[示例/imagenet eval.py](https://github.com/cadene/pretrained-models.pytorch/blob/master/examples/imagenet eval.py)来评估imagenet valset上的预训练模型。

```
$python examples/imagenet_eval.py/local/common data/imagenet_2012/images-a nasnetalage-b 20-e
>;*acc@192.693,acc@5 96.13
````



---|---|---|---
pnasnet-5-large[tensorflow](https://github.com/tensorflow/models/tree/master/research/slim)82.858 96.182
[pnasnet-5-large](https://github.com/cadene/pretrained models.pytorch pnasnet)我们的端口82.736 95.992
nasnet-a-large|【Tensorflow】(https://github.com/tensorflow/models/tree/master/research/slim)82.693 96.163
【NASNET-A-LARGE】(https://github.com/cadene/pretrained models.pytorch NASNET)our porting 82.566 96.086
senet154【CAffe】(https://github.com/hujie-frank/senet)81.32|95.53
[senet154](https://github.com/cadene/cadene/pretrained models.pytorch senet)我们的移植81.304 95.498
波利尼特[caffe](https://github.com/cuhk-mmlab/polynet)81.29 95.75
[polynet](https://github.com/cadene/pretrained models.pytorch polynet)我们的移植81.002.002;81.002;81.002;81.002是的|95.624
激励resnetv2[张力流](https://github.com/tensorflow/models/tree/master/slim)80.4 95.3
激励v4[张力流](https://github.com/tensorflow/models/tree/master/slim)80.2 95.3
[se-resnext101 32x4d](https://github.com/cadene/pretrained models.pytorch senet)|我们的移植80.236 95.028
se-resnext101_32x4d[caffe](https://github.com/hujie-frank/senet)80.19 95.04
[inceptionresnetv2](https://github.com/cadene/pretrained models.pytorch inception)我们的移植80.170|95.234
[inceptionv4](https://github.com/cadene/pretrained models.pytorch inception)我们的移植80.062 94.926
[dualpathnet107_u 5k](https://github.com/cadene/pretrained models.pytorch dualpathnetworks)我们的移植79.746 94.684
resnext101_u 64x4d|[火炬7](https://github.com/facebookresearch/resnext)79.6 94.7
[双路径网131](https://github.com/cadene/pretrained models.pytorch dualpathnetworks)我们的移植79.432 94.574
[双路径网92(https://github.com/cadene/pretrained models.pytorch dualpathnetworks)我们的移植|79.400 94.620
[DualPathNet98](https://github.com/cadene/pretrained models.pytorch dualPathNetworks)我们的移植79.224 94.488
[se-resnext50_u 32x4d](https://github.com/cadene/pretrained models.pytorch senet)我们的移植79.076 94.434
se-resnext50 x4d|[咖啡馆](https://github.com/hujie-frank/senet)79.03 94.46
[例外](https://github.com/cadene/pretrained models.pytorch例外)[凯拉斯](https://github.com/keras-team/keras/blob/master/keras/applications/xception.py)79.000|94.500
[resnext101_u 64x4d](https://github.com/cadene/pretrained models.pytorch resnext)我们的移植78.956 94.252
[xception](https://github.com/cadene/pretrained models.pytorch xception)我们的移植78.888 94.292
resnext101 x4d|[火炬7号](https://github.com/facebookresearch/resnext)78.8 94.4
se-resnet152[咖啡馆](https://github.com/hujie-frank/senet)78.66 94.46
【SE-resnet152】(https://github.com/cadene/cadene/pretrained models.pytorch-senet)我们的移植78.658 94.374
resnet152;【pytorch】(https://github.com/pytorch/vision models 78.428 94.110
【SE-resnet101】(https://github.com/cadene/pretrained models.pytorch-spectorch-senet)我们的移植78 78.78124; 78.658 78.658.396条|94.258
se-resnet101[caffe](https://github.com/hujie-frank/senet)78.25 94.28
[resnext101 x4d](https://github.com/cadene/pretrained models.pytorch resnext)我们的移植78.188 93.886
fbrenet152[torch7](https://github.com/facebook/facebook/fb.resnet.resnet.torch)77.77.77.25 94.28 84个|93.84
se-resnet50[caffe](https://github.com/hujie-frank/senet)77.63 93.64
[se-resnet50](https://github.com/cadene/pretrained models.pytorch senet)our porting 77.636 93.752
[densenet161](https://github.com/cadene/pretrained models.pytorch torchvision)|[火炬](https://github.com/pytorch/vision models)77.560 93.798
[resnet101](https://github.com/cadene/pretrained models.pytorch torchvision)[火炬](https://github.com/pytorch/vision models)77.438|93.672
[fbresnet152](https://github.com/cadene/pretrained models.pytorch facebook resnet)我们的移植77.386 93.594
[inceptionv3](https://github.com/cadene/pretrained models.pytorch inception)[pytorch](https://github.com/pytorch/vision models)77.294|93.454
[densenet201](https://github.com/cadene/pretrained models.pytorch torchvision)[pytorch](https://github.com/pytorch/vision models)77.152 93.548
[dualpathnet68b(https://github.com/cadene/pretrained models.pytorch dualpathnetworks)我们的端口77.034|93.590
[cafferesnet101](https://github.com/cadene/pretrained models.pytorch caffe resnet)[caffe](https://github.com/kaiminghe/deep-remained-networks)76.400 92.900
[cafferesnet101](https://github.com/cadene/pretrained models.pytorch caffe resnet)我们的端口76.200|92.766
[densenet169](https://github.com/cadene/pretrained models.pytorch torchvision)[pytorch](https://github.com/pytorch/vision models)76.026 92.992
[resnet50](https://github.com/cadene/pretrained models.pytorch[pytorch](https://github.com/pytorch/vision models)|76.002 92.980
[DualPathNet68](https://github.com/cadene/pretrained models.pytorch DualPathNetworks)我们的移植75.868 92.774
[densenet121](https://github.com/cadene/pretrained models.pytorch torchvision)[pytorch](https://github.com/pytorch/vision models)74.646|92.136
[vgg19-bn](https://github.com/cadene/pretrained models.pytorch torchvision)[pytorch](https://github.com/pytorch/vision models)74.266 92.066
nasnet-a-mobile[tensorflow](https://github.com/tensorflow/models/tree/master/research/slim)74.0|91.6
[NASNET-A-Mobile](https://github.com/veronikayurchuk/pretrained-models.pytorch/blob/master/pretrainedmodels/models/nasnet_mobile.py)我们的移植74.080 91.740
[resnet34](https://github.com/cadene/pretrained models.pytorch torchvision)|[Pythorch](https://github.com/Pythorch/vision models)73.554 91.456
[初始](https://github.com/cadene/pretrained models.Pythorch binception)我们的端口73.524 91.562
[vgg16_u bn](https://github.com/cadene/pretrained models.Pythorch torchvision)|[火炬](https://github.com/pytorch/vision模型)73.518 91.608
[vgg19](https://github.com/cadene/cadene/pretrained models.pytorch torchvision[pytorch](https://github.com/pytorch/vision模型)72.080 90.822
[vgg16](https://github.com/github.com/cadene/cadene/cadene/pretrained models.pytorch/pretrained models.pytorch.pytorch).|[Pythorch](https://github.com/pytorch/vision models)71.636 90.354
[vgg13 bn](https://github.com/cadene/pretrained models.pytorch torchvision)[Pythorch](https://github.com/pytorch/vision models)71.508|90.494
[vgg11-bn](https://github.com/cadene/pretrained models.pytorch torchvision)[pytorch](https://github.com/pytorch/vision models)70.452 89.818
[resnet18](https://github.com/ca)DENE/pretrained models.pytorch torchvision[pytorch](https://github.com/pytorch/vision models)70.142 89.274
[vgg13](https://github.com/cadene/pretrained models.pytorch torchvision)[pytorch](https://github.com/pytorch/vision models)69.662|89.264
[vgg11](https://github.com/cadene/pretrained models.pytorch torchvision)[pytorch](https://github.com/pytorch/vision models)68.970 88.746
[squezenet1(https://github.com/cadene/pretrained models.pytorch torchvision)[pytorch](https://github.com/pytorch/vision models)|58.250 80.800
[挤压网1_0](https://github.com/cadene/pretrained models.pytorch torchvision)[喷灯](https://github.com/pytorch/vision models)58.108 80.428
[亚历克赛网](https://github.com/cadene/pretrained models.pytorch torchvision)|[Pythorch](https://github.com/Pythorch/vision models)56.432 79.194


注意:
-Pythorch版本的resnet152不是Torch7的移植,而是由Facebook重新训练的。
-对于Polynet求值,在不保留纵横比和然后使用结果图像的中心331×331补丁。

你一定要全试试!:p





>请参见[compute imagenet有效性度量](https://github.com/cadene/cadene/pretrained models.pytorch/computeimagenet有效性度量)
















<


NASNET*

来源:[tensorflowslim repo](https://github.com/tensorflow/models/tree/master/research/slim)

-`nasnetalage(num廑classes=1000,pretrained='imagenet')`
-`nasnetalage(num廑classes=1001,pretrained='imagenet+background')`
-`nasnetamabile(num廑classes=1000,pretrained='imagenet')`

\facebook resnet*


source:[torch7 repo of facebook](https://github.com/facebook/fb.resnet.torch)

与torchvision的resnet*有些不同。resnet152是目前唯一可用的一个。

-`fbresnet152(num_classes=1000,pretrained='imagenet')`


pretrained='imagenet')`



\pretrained="imagenet")`
-`inceptionresnetv2(num戋classes=1001,pretrained="imagenet+background")`
-`inceptionv4(num戋classes=1000,pretrained="imagenet")`
-`inceptionv4(num戋classes=1001,pretrained="imagenet+background")`
-`inceptionv3(num戋classes=1000,pretrained="imagenet")`


pretrained="imagenet")`

resnext*

pretrained='imagenet')`


repo](https://github.com/rwightman/pytorch dpn pretrained)。

[如您所见](https://github.com/rwightman/pytorch-dpn-pretrained)DualPathNetworks允许您尝试不同的规模。此回购协议中的默认值为0.875,这意味着在切换到224之前,原始输入大小为256。

-`dpn68(num_类es=1000,pretrained="imagenet")`
-`dpn98(num廑classes=1000,pretrained="imagenet")`
-`dpn131(num廑classes=1000,pretrained="imagenet")`
-`dpn68b(num廑classes=1000,pretrained="imagenet+5k")`
-`dpn92(num廑classes=1000,pretrained="imagenet+5k")`
-`dpn107(num廑classes=1000,pretrained='imagenet+5k')`

`'imagenet+5k'`表示在对imagenet1k进行微调之前,已在imagenet5k上对网络进行了预训练。


[T Standley]提供了移植功能(https://github.com/t standley/xception pytorch)。

-`xception(num_classes=1000,






<
<
<<<<<<<<<<<<<<<<



资料来源:胡杰胡的咖啡回购(https://github.com/hu jie-frank/senet)

-`SEnet154(num-class=1000,pretrained='imagenet')`
-`se resnet50(num-class=1000,pretrained='imagenet')`
-`se resnet101(num-resnet101(num-class=1000,pretrained='imagenet')``
-`
-`se resnet101(num-res=1000,pretrained="imagenet")`
-`se戋resnet152(num戋classes=1000,pretrained="imagenet")`
-`se戋resnext50戋32x4d(num戋classes=1000,pretrained="imagenet")`
-`se戋resnext101戋32x4d(num戋classes=1000,pretrained="imagenet")`

pnasnet*

source:[tensorflow slim repo](https://github.com/tensorflow/models/tree/master/research/slim)

-`pnasnet5large(num_classes=1000,pretrained="imagenet")`
-`pnasnet5large(num_classes=1001,pretrained='imagenet+background')`


\pretrained="imagenet")`


pretrained="imagenet")`
-`resnet34(num廑classes=1000,pretrained="imagenet")`
-`resnet50(num廑classes=1000,pretrained="imagenet")`
-`resnet101(num廑classes=1000,pretrained="imagenet")`
-`resnet152(num廑classes=1000,pretrained="imagenet")`
-`densenet121(num廑classes=1000,pretrained="imagenet")`
-`densenet161(num嫒classes=1000,pretrained="imagenet")`
-`densenet169(num嫒classes=1000,pretrained="imagenet")`
-`densenet201(num嫒classes=1000,pretrained="imagenet")`
-`squezenet1嫒0(num嫒classes=1000,pretrained="imagenet")`
-`squezenet1廑1(num廑classes=1000,pretrained="imagenet")`
-`alexnet(num廑classes=1000,pretrained="imagenet")`
-`vgg11(num廑classes=1000,pretrained="imagenet")`
-`vgg16(num廑classes=1000,预训练的"imagenet")`
-`vgg19(num廑classes=1000,pretrained='imagenet')`
-`vgg11廑bn(num廑classes=1000,pretrained='imagenet')`
-`vgg13廑bn(num廑classes=1000,pretrained='imagenet')`
-`vgg19廑bn(num廑classes=1000,pretrained="imagenet")`



`列表`由3个数字组成:

-色通道数,
-输入图像的高度,
-输入图像的宽度。

示例:

-`[3,299,299]`对于初始*网络,
-`[3,224,224]`用于resnet*网络。



`模型。输入_space`

str/>attribut类型表示图像的颜色空间。可以是"rgb"或"bgr"。



概念网络。



0.406]`对于resnet*网络。



model.std`

0.225]`用于resnet*网络。



\正在工作(可能不可用)


方法,用于从图像中提取特征。


使用"fbresnet152"加载模型时的示例:

``python
``print(input_.size())(1,3224,224)
输出=模型。特征(input_)
打印(output.size())(12048,1,1)

打印(input_.size())(1,3448448)
输出=模型。特征(input_)
打印(output.size())(12048,7,7)
``

\工作进行中(可能不可用)


用于从图像中分类特征的方法。


使用"fbresnet152"加载模型时的示例:

``python
output=model.features(input_)
print(output.size())(12048,1,1)
output=model.logits(output)
print(output.size())35;(11000)
`````

可以根据需要覆盖它。

**注意**:一个好的做法是使用"model.\u call"作为您选择的函数,将输入转发到您的模型。请参见下面的示例。

``没有模型的python
1000)
```

此模块是前向过程中要调用的最后一个模块。

-可以替换为自适应的"nn.linear"进行微调。
-可以替换为"pretrained.utils.identity"进行特征提取。

使用"fbresnet152"加载模型时的示例:

``python
print(input_.size())(1,3224224)
output=model.features(input_)
print(output.size())(12048,1,1)
output=model.logits(output)
print(output.size())#(11000)

=pretrained.utils.identity()
output=模型(input_)
打印(output.size())(1,2048年)
`````





>手工移植resnet152,手工移植resnet152

`````
``````
``````````````>th pretrainedmodels/fbresnet/resnet152/resnet152/u dump.lua
python pretrainedmodels/fbresnet/resnet152/u load.pyy
```````



>
``````````````````````````天然气resnext

https://github.com/clcarwin/convert_torch_to_pytorch

nasnet手工移植,inceptionv4和inceptionresnetv2

https://github.com/cadene/tensorflow model zoo.torch


欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JavaFX进度条从单独的函数更改而来   jvm使用java服务器选项   java在<li>元素中查找同名的最后一个链接   java问题将参数传递给不同公共类中的构造函数   如何在php中从java函数中获取字符串   java如何在Android中动态显示多个tile   java仅使用Ribbon而不使用任何服务注册表是否可以实现负载平衡?   Jersey 1.19版本的java Swagger JAXRS出现“冲突URI模板”错误   带H2数据库的java Spring boot jpa   从12:00:00到00:00:00的日期转换   Android中的java如何设置文本?   java密钥库“不支持的保护参数”   http使用Java在Java中发送httprequest。净包   SpringJava刷新数据库   java在Spring Boot应用程序中使用嵌入式MongoDb和MongoTemplate失败   java需要什么MatOfMatch对象?   xml使用Java中的合并算法将两个值合并为单个值   java SQLite数据库不保存数据为什么不工作