Coder Social home page Coder Social logo

d-li14 / mobilenetv3.pytorch Goto Github PK

View Code? Open in Web Editor NEW
512.0 8.0 123.0 108.05 MB

74.3% MobileNetV3-Large and 67.2% MobileNetV3-Small model on ImageNet

Home Page: https://arxiv.org/abs/1905.02244

License: MIT License

Python 100.00%
mobilenetv3 pytorch-implementation imagenet pretrained-models iccv2019

mobilenetv3.pytorch's Introduction

Duo Li's github stats

mobilenetv3.pytorch's People

Contributors

d-li14 avatar erjanmx avatar gemfield avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobilenetv3.pytorch's Issues

RuntimeError: Error(s) in loading state_dict for MobileNetV3:

Thank you for your work.
Pull all source and create test.py and run it.

import torch
from mobilenetv3 import mobilenetv3_large, mobilenetv3_small

net_large = mobilenetv3_large()
net_small = mobilenetv3_small()

net_large.load_state_dict(torch.load('pretrained/mobilenetv3-large-1cd25616.pth'))
net_small.load_state_dict(torch.load('pretrained/mobilenetv3-small-55df8e1f.pth'))

But below error was occurred.

Traceback (most recent call last):
File "test.py", line 7, in
net_large.load_state_dict(torch.load('pretrained/mobilenetv3-large-1cd25616.pth'))
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 839, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for MobileNetV3:
Missing key(s) in state_dict: "classifier.2.weight", "classifier.2.bias".
Unexpected key(s) in state_dict: "classifier.3.weight", "classifier.3.bias".

Could check this?

not able to replicate the results

Hi,
I am running your implementation with the hyper parameters you provided using the examples/imagenet/main.py provided by PyTorch. Seems like the accuracy metrics are stuck around after epoch 20. Could you please share your training script with hyper parameter settings?

mean and std

Hi,i want to know what is the mean and std of the image when you training?

Placement of Activation *after* SEBlock

Hi. In your code, you place the activation (hard-swish), after the SE Block

self.conv = nn.Sequential(
                # pw
                nn.Conv2d(inp, hidden_dim, 1, 1, 0, bias=False),
                nn.BatchNorm2d(hidden_dim),
                h_swish() if use_hs else nn.ReLU(inplace=True),
                # dw
                nn.Conv2d(hidden_dim, hidden_dim, kernel_size, stride, (kernel_size - 1) // 2, groups=hidden_dim, bias=False),
                nn.BatchNorm2d(hidden_dim),
                # Squeeze-and-Excite
                SELayer(hidden_dim) if use_se else nn.Identity(),
                h_swish() if use_hs else nn.ReLU(inplace=True), ## <-- HERE!!!
                # pw-linear
                nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False),
                nn.BatchNorm2d(oup),
            )

Is it correct, or should it be placed before the SE Block?

torch 2.0.1, met some problem in function `accuracy()` and solved

line 18
the function view() has some problem when calculating topk=5
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces).

the instruction may solve this problem
correct_k = correct[:k].view(-1).float().sum(0) changed to correct_k = correct[:k].float().sum()

Training procedure

Specifically, what optimization algorithm, learning rate schedule, and batch size did you use?

Add FPN head

Hi, Thanks for your sharing an awesome work,
This is not an issue, just like a question, please help:
I would like to add FPN head to your mnetv3 backbone. I see that FPN requires the consecutive double size of the return layers ( 32 -> 64 -> 128...). But the size of the output layers of mobilenetv3 are 16 ->24 ->40 ,... which do not adopt the rule. Do you have any comments?
anyway, if modify the net, I can successfully build but with worse accuracy. Thank you.

Question on the Madds of MobileNet-V3

Thank you for your code! It is really very helpful for our project.
But I have a little question. When testing the Madds of mobilenetv3_large with Op_counter, we got 239M instead of 217M reported in the repo (Searching for MobileNetV3). Are there some differences in structures between the mobilenetv3 in this repo and the original one? Or it is due to the way to calculate Madds?

Error when loading weights for large model

Code:

net_large.load_state_dict(torch.load('pretrained/mobilenetv3-large-657e7b3d.pth'))

Error:

RuntimeError: Error(s) in loading state_dict for MobileNetV3:
	Missing key(s) in state_dict: "classifier.0.weight", "classifier.0.bias", "classifier.3.weight", "classifier.3.bias". 
	Unexpected key(s) in state_dict: "classifier.1.weight", "classifier.1.bias", "classifier.5.weight", "classifier.5.bias". 

incorrect network structure

Hi @d-li14

Thank you for your work.
When I read the original MobileNetV3 paper and compared with your code, I noticed a discrepancy in the code. Specifically, in this line [https://github.com/d-li14/mobilenetv3.pytorch/blob/master/mobilenetv3.py#L211], the code is: [5, 672, 160, 1, 1, 2].
However, the corresponding line in table 1 of the original paper is: 7
2 × 160, bneck, 5x5 960-160-checkmark-HS-1 (row 6 counted from the bottom)
image

Can you help to confirm that and re-adjust your code accordingly?

Thanks,

P

request for training loss curve

@d-li14 Thank you very much for your work. I was wondering if you can provide train loss curve as well? It can be in the form of training log in txt or plot like this: https://github.com/d-li14/octconv.pytorch (https://raw.githubusercontent.com/d-li14/octconv.pytorch/master/fig/ablation.png)

Btw, you may want to consider replacing conv2d + pad for future work as:

conv2d = nn.Sequential(
    nn.ZeroPad([ x1,y1,x2,y2]),
    nn.Conv2d( in_channel, out_channel, kernel_size, stride, padding=0, ...)
)

if you do this, and by selecting correct [ x1,y1,x2,y2], your model can be converted to tf or tf/keras or tflite model with same accuracy. tensorflow tf uses unsymmetrical padding. I have make a pytorch to tf converter for your mobilenet v3 and verified that numerical accuracy can be obtained (numerical difference of less than 1e-6)

Many uses of mobilenet are in mobile phone and are served in tflite. tiflite also allows for 8-bit quantisation

you model is wrong。

the first inverted residual block is not using deepthwise separable convolution(groups=16)

image

missing keys for mobilenet v3-large?

Hello!

First of all, thanks for your great implementation of MobileNetV3

However, when I try to use your pretrained model (large model),

it raises error as

RuntimeError: Error(s) in loading state_dict for MobileNetV3:
        Missing key(s) in state_dict: "classifier.0.weight", "classifier.0.bias", "classifier.3.weight", "classifier.3.bias".
        Unexpected key(s) in state_dict: "classifier.1.weight", "classifier.1.bias", "classifier.5.weight", "classifier.5.bias".

Is there any difference between current implementation and pretrained checkpoint?

What is Sequential() in model.classifier used for?

Thank you for your code and pretrained model, I am a newbie in Pytorch and I have a question for the architecture. According to Pytorch document, Sequential is used to add modules.
However, in the classifier part, sequential() is empty inside. (classifier[1], classifier[4], classifier[5])
image
Could you please explain for me about that.
Thank you very much

Incompatible pretrained models

Get errors when trying to load the pretrained models. In particular, it looks like the state_dict for the small model is actually based on the large model.

For the large model:

RuntimeError: Error(s) in loading state_dict for MobileNetV3:
Missing key(s) in state_dict: "classifier.0.weight", "classifier.0.bias", "classifier.3.weight", "classifier.3.bias".
Unexpected key(s) in state_dict: "classifier.1.weight", "classifier.1.bias", "classifier.5.weight", "classifier.5.bias".

For the small model:

RuntimeError: Error(s) in loading state_dict for MobileNetV3:
Missing key(s) in state_dict: "features.1.conv.3.fc.0.weight", "features.1.conv.3.fc.0.bias", "features.1.conv.3.fc.2.weight", "features.1.conv.3.fc.2.bias", "features.7.conv.5.fc.0.weight", "features.7.conv.5.fc.0.bias", "features.7.conv.5.fc.2.weight", "features.7.conv.5.fc.2.bias", "features.8.conv.5.fc.0.weight", "features.8.conv.5.fc.0.bias", "features.8.conv.5.fc.2.weight", "features.8.conv.5.fc.2.bias", "features.9.conv.5.fc.0.weight", "features.9.conv.5.fc.0.bias", "features.9.conv.5.fc.2.weight", "features.9.conv.5.fc.2.bias", "features.10.conv.5.fc.0.weight", "features.10.conv.5.fc.0.bias", "features.10.conv.5.fc.2.weight", "features.10.conv.5.fc.2.bias", "conv.1.fc.0.weight", "conv.1.fc.0.bias", "conv.1.fc.2.weight", "conv.1.fc.2.bias", "classifier.0.weight", "classifier.0.bias", "classifier.1.running_mean", "classifier.1.running_var", "classifier.3.weight", "classifier.3.bias", "classifier.4.weight", "classifier.4.bias", "classifier.4.running_mean", "classifier.4.running_var".
Unexpected key(s) in state_dict: "features.12.conv.0.weight", "features.12.conv.1.weight", "features.12.conv.1.bias", "features.12.conv.1.running_mean", "features.12.conv.1.running_var", "features.12.conv.1.num_batches_tracked", "features.12.conv.3.weight", "features.12.conv.4.weight", "features.12.conv.4.bias", "features.12.conv.4.running_mean", "features.12.conv.4.running_var", "features.12.conv.4.num_batches_tracked", "features.12.conv.5.fc.0.weight", "features.12.conv.5.fc.0.bias", "features.12.conv.5.fc.2.weight", "features.12.conv.5.fc.2.bias", "features.12.conv.7.weight", "features.12.conv.8.weight", "features.12.conv.8.bias", "features.12.conv.8.running_mean", "features.12.conv.8.running_var", "features.12.conv.8.num_batches_tracked", "features.13.conv.0.weight", "features.13.conv.1.weight", "features.13.conv.1.bias", "features.13.conv.1.running_mean", "features.13.conv.1.running_var", "features.13.conv.1.num_batches_tracked", "features.13.conv.3.weight", "features.13.conv.4.weight", "features.13.conv.4.bias", "features.13.conv.4.running_mean", "features.13.conv.4.running_var", "features.13.conv.4.num_batches_tracked", "features.13.conv.5.fc.0.weight", "features.13.conv.5.fc.0.bias", "features.13.conv.5.fc.2.weight", "features.13.conv.5.fc.2.bias", "features.13.conv.7.weight", "features.13.conv.8.weight", "features.13.conv.8.bias", "features.13.conv.8.running_mean", "features.13.conv.8.running_var", "features.13.conv.8.num_batches_tracked", "features.14.conv.0.weight", "features.14.conv.1.weight", "features.14.conv.1.bias", "features.14.conv.1.running_mean", "features.14.conv.1.running_var", "features.14.conv.1.num_batches_tracked", "features.14.conv.3.weight", "features.14.conv.4.weight", "features.14.conv.4.bias", "features.14.conv.4.running_mean", "features.14.conv.4.running_var", "features.14.conv.4.num_batches_tracked", "features.14.conv.5.fc.0.weight", "features.14.conv.5.fc.0.bias", "features.14.conv.5.fc.2.weight", "features.14.conv.5.fc.2.bias", "features.14.conv.7.weight", "features.14.conv.8.weight", "features.14.conv.8.bias", "features.14.conv.8.running_mean", "features.14.conv.8.running_var", "features.14.conv.8.num_batches_tracked", "features.15.conv.0.weight", "features.15.conv.1.weight", "features.15.conv.1.bias", "features.15.conv.1.running_mean", "features.15.conv.1.running_var", "features.15.conv.1.num_batches_tracked", "features.15.conv.3.weight", "features.15.conv.4.weight", "features.15.conv.4.bias", "features.15.conv.4.running_mean", "features.15.conv.4.running_var", "features.15.conv.4.num_batches_tracked", "features.15.conv.5.fc.0.weight", "features.15.conv.5.fc.0.bias", "features.15.conv.5.fc.2.weight", "features.15.conv.5.fc.2.bias", "features.15.conv.7.weight", "features.15.conv.8.weight", "features.15.conv.8.bias", "features.15.conv.8.running_mean", "features.15.conv.8.running_var", "features.15.conv.8.num_batches_tracked", "classifier.5.weight", "classifier.5.bias".
size mismatch for features.2.conv.0.weight: copying a param with shape torch.Size([64, 16, 1, 1]) from checkpoint, the shape in current model is torch.Size([72, 16, 1, 1]).
size mismatch for features.2.conv.1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([72]).
size mismatch for features.2.conv.1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([72]).
size mismatch for features.2.conv.1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([72]).
size mismatch for features.2.conv.1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([72]).
size mismatch for features.2.conv.3.weight: copying a param with shape torch.Size([64, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([72, 1, 3, 3]).
size mismatch for features.2.conv.4.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([72]).
size mismatch for features.2.conv.4.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([72]).
size mismatch for features.2.conv.4.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([72]).
size mismatch for features.2.conv.4.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([72]).
size mismatch for features.2.conv.7.weight: copying a param with shape torch.Size([24, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([24, 72, 1, 1]).
size mismatch for features.3.conv.0.weight: copying a param with shape torch.Size([72, 24, 1, 1]) from checkpoint, the shape in current model is torch.Size([88, 24, 1, 1]).
size mismatch for features.3.conv.1.weight: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([88]).
size mismatch for features.3.conv.1.bias: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([88]).
size mismatch for features.3.conv.1.running_mean: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([88]).
size mismatch for features.3.conv.1.running_var: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([88]).
size mismatch for features.3.conv.3.weight: copying a param with shape torch.Size([72, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([88, 1, 3, 3]).
size mismatch for features.3.conv.4.weight: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([88]).
size mismatch for features.3.conv.4.bias: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([88]).
size mismatch for features.3.conv.4.running_mean: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([88]).
size mismatch for features.3.conv.4.running_var: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([88]).
size mismatch for features.3.conv.7.weight: copying a param with shape torch.Size([24, 72, 1, 1]) from checkpoint, the shape in current model is torch.Size([24, 88, 1, 1]).
size mismatch for features.4.conv.0.weight: copying a param with shape torch.Size([72, 24, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 24, 1, 1]).
size mismatch for features.4.conv.1.weight: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.1.bias: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.1.running_mean: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.1.running_var: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.3.weight: copying a param with shape torch.Size([72, 1, 5, 5]) from checkpoint, the shape in current model is torch.Size([96, 1, 5, 5]).
size mismatch for features.4.conv.4.weight: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.4.bias: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.4.running_mean: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.4.running_var: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.5.fc.0.weight: copying a param with shape torch.Size([18, 72]) from checkpoint, the shape in current model is torch.Size([24, 96]).
size mismatch for features.4.conv.5.fc.0.bias: copying a param with shape torch.Size([18]) from checkpoint, the shape in current model is torch.Size([24]).
size mismatch for features.4.conv.5.fc.2.weight: copying a param with shape torch.Size([72, 18]) from checkpoint, the shape in current model is torch.Size([96, 24]).
size mismatch for features.4.conv.5.fc.2.bias: copying a param with shape torch.Size([72]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.4.conv.7.weight: copying a param with shape torch.Size([40, 72, 1, 1]) from checkpoint, the shape in current model is torch.Size([40, 96, 1, 1]).
size mismatch for features.5.conv.0.weight: copying a param with shape torch.Size([120, 40, 1, 1]) from checkpoint, the shape in current model is torch.Size([240, 40, 1, 1]).
size mismatch for features.5.conv.1.weight: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.1.bias: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.1.running_mean: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.1.running_var: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.3.weight: copying a param with shape torch.Size([120, 1, 5, 5]) from checkpoint, the shape in current model is torch.Size([240, 1, 5, 5]).
size mismatch for features.5.conv.4.weight: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.4.bias: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.4.running_mean: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.4.running_var: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.5.fc.0.weight: copying a param with shape torch.Size([30, 120]) from checkpoint, the shape in current model is torch.Size([60, 240]).
size mismatch for features.5.conv.5.fc.0.bias: copying a param with shape torch.Size([30]) from checkpoint, the shape in current model is torch.Size([60]).
size mismatch for features.5.conv.5.fc.2.weight: copying a param with shape torch.Size([120, 30]) from checkpoint, the shape in current model is torch.Size([240, 60]).
size mismatch for features.5.conv.5.fc.2.bias: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.5.conv.7.weight: copying a param with shape torch.Size([40, 120, 1, 1]) from checkpoint, the shape in current model is torch.Size([40, 240, 1, 1]).
size mismatch for features.6.conv.0.weight: copying a param with shape torch.Size([120, 40, 1, 1]) from checkpoint, the shape in current model is torch.Size([240, 40, 1, 1]).
size mismatch for features.6.conv.1.weight: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.1.bias: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.1.running_mean: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.1.running_var: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.3.weight: copying a param with shape torch.Size([120, 1, 5, 5]) from checkpoint, the shape in current model is torch.Size([240, 1, 5, 5]).
size mismatch for features.6.conv.4.weight: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.4.bias: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.4.running_mean: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.4.running_var: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.5.fc.0.weight: copying a param with shape torch.Size([30, 120]) from checkpoint, the shape in current model is torch.Size([60, 240]).
size mismatch for features.6.conv.5.fc.0.bias: copying a param with shape torch.Size([30]) from checkpoint, the shape in current model is torch.Size([60]).
size mismatch for features.6.conv.5.fc.2.weight: copying a param with shape torch.Size([120, 30]) from checkpoint, the shape in current model is torch.Size([240, 60]).
size mismatch for features.6.conv.5.fc.2.bias: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([240]).
size mismatch for features.6.conv.7.weight: copying a param with shape torch.Size([40, 120, 1, 1]) from checkpoint, the shape in current model is torch.Size([40, 240, 1, 1]).
size mismatch for features.7.conv.0.weight: copying a param with shape torch.Size([240, 40, 1, 1]) from checkpoint, the shape in current model is torch.Size([120, 40, 1, 1]).
size mismatch for features.7.conv.1.weight: copying a param with shape torch.Size([240]) from checkpoint, the shape in current model is torch.Size([120]).
size mismatch for features.7.conv.1.bias: copying a param with shape torch.Size([240]) from checkpoint, the shape in current model is torch.Size([120]).
size mismatch for features.7.conv.1.running_mean: copying a param with shape torch.Size([240]) from checkpoint, the shape in current model is torch.Size([120]).
size mismatch for features.7.conv.1.running_var: copying a param with shape torch.Size([240]) from checkpoint, the shape in current model is torch.Size([120]).
size mismatch for features.7.conv.3.weight: copying a param with shape torch.Size([240, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([120, 1, 5, 5]).
size mismatch for features.7.conv.4.weight: copying a param with shape torch.Size([240]) from checkpoint, the shape in current model is torch.Size([120]).
size mismatch for features.7.conv.4.bias: copying a param with shape torch.Size([240]) from checkpoint, the shape in current model is torch.Size([120]).
size mismatch for features.7.conv.4.running_mean: copying a param with shape torch.Size([240]) from checkpoint, the shape in current model is torch.Size([120]).
size mismatch for features.7.conv.4.running_var: copying a param with shape torch.Size([240]) from checkpoint, the shape in current model is torch.Size([120]).
size mismatch for features.7.conv.7.weight: copying a param with shape torch.Size([80, 240, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 120, 1, 1]).
size mismatch for features.7.conv.8.weight: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for features.7.conv.8.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for features.7.conv.8.running_mean: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for features.7.conv.8.running_var: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for features.8.conv.0.weight: copying a param with shape torch.Size([200, 80, 1, 1]) from checkpoint, the shape in current model is torch.Size([144, 48, 1, 1]).
size mismatch for features.8.conv.1.weight: copying a param with shape torch.Size([200]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.8.conv.1.bias: copying a param with shape torch.Size([200]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.8.conv.1.running_mean: copying a param with shape torch.Size([200]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.8.conv.1.running_var: copying a param with shape torch.Size([200]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.8.conv.3.weight: copying a param with shape torch.Size([200, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([144, 1, 5, 5]).
size mismatch for features.8.conv.4.weight: copying a param with shape torch.Size([200]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.8.conv.4.bias: copying a param with shape torch.Size([200]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.8.conv.4.running_mean: copying a param with shape torch.Size([200]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.8.conv.4.running_var: copying a param with shape torch.Size([200]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.8.conv.7.weight: copying a param with shape torch.Size([80, 200, 1, 1]) from checkpoint, the shape in current model is torch.Size([48, 144, 1, 1]).
size mismatch for features.8.conv.8.weight: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for features.8.conv.8.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for features.8.conv.8.running_mean: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for features.8.conv.8.running_var: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([48]).
size mismatch for features.9.conv.0.weight: copying a param with shape torch.Size([184, 80, 1, 1]) from checkpoint, the shape in current model is torch.Size([288, 48, 1, 1]).
size mismatch for features.9.conv.1.weight: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([288]).
size mismatch for features.9.conv.1.bias: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([288]).
size mismatch for features.9.conv.1.running_mean: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([288]).
size mismatch for features.9.conv.1.running_var: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([288]).
size mismatch for features.9.conv.3.weight: copying a param with shape torch.Size([184, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([288, 1, 5, 5]).
size mismatch for features.9.conv.4.weight: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([288]).
size mismatch for features.9.conv.4.bias: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([288]).
size mismatch for features.9.conv.4.running_mean: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([288]).
size mismatch for features.9.conv.4.running_var: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([288]).
size mismatch for features.9.conv.7.weight: copying a param with shape torch.Size([80, 184, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 288, 1, 1]).
size mismatch for features.9.conv.8.weight: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.9.conv.8.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.9.conv.8.running_mean: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.9.conv.8.running_var: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.10.conv.0.weight: copying a param with shape torch.Size([184, 80, 1, 1]) from checkpoint, the shape in current model is torch.Size([576, 96, 1, 1]).
size mismatch for features.10.conv.1.weight: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.10.conv.1.bias: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.10.conv.1.running_mean: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.10.conv.1.running_var: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.10.conv.3.weight: copying a param with shape torch.Size([184, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([576, 1, 5, 5]).
size mismatch for features.10.conv.4.weight: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.10.conv.4.bias: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.10.conv.4.running_mean: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.10.conv.4.running_var: copying a param with shape torch.Size([184]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.10.conv.7.weight: copying a param with shape torch.Size([80, 184, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 576, 1, 1]).
size mismatch for features.10.conv.8.weight: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.10.conv.8.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.10.conv.8.running_mean: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.10.conv.8.running_var: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.11.conv.0.weight: copying a param with shape torch.Size([480, 80, 1, 1]) from checkpoint, the shape in current model is torch.Size([576, 96, 1, 1]).
size mismatch for features.11.conv.1.weight: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.1.bias: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.1.running_mean: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.1.running_var: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.3.weight: copying a param with shape torch.Size([480, 1, 3, 3]) from checkpoint, the shape in current model is torch.Size([576, 1, 5, 5]).
size mismatch for features.11.conv.4.weight: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.4.bias: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.4.running_mean: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.4.running_var: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.5.fc.0.weight: copying a param with shape torch.Size([120, 480]) from checkpoint, the shape in current model is torch.Size([144, 576]).
size mismatch for features.11.conv.5.fc.0.bias: copying a param with shape torch.Size([120]) from checkpoint, the shape in current model is torch.Size([144]).
size mismatch for features.11.conv.5.fc.2.weight: copying a param with shape torch.Size([480, 120]) from checkpoint, the shape in current model is torch.Size([576, 144]).
size mismatch for features.11.conv.5.fc.2.bias: copying a param with shape torch.Size([480]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for features.11.conv.7.weight: copying a param with shape torch.Size([112, 480, 1, 1]) from checkpoint, the shape in current model is torch.Size([96, 576, 1, 1]).
size mismatch for features.11.conv.8.weight: copying a param with shape torch.Size([112]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.11.conv.8.bias: copying a param with shape torch.Size([112]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.11.conv.8.running_mean: copying a param with shape torch.Size([112]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for features.11.conv.8.running_var: copying a param with shape torch.Size([112]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for conv.0.0.weight: copying a param with shape torch.Size([960, 160, 1, 1]) from checkpoint, the shape in current model is torch.Size([576, 96, 1, 1]).
size mismatch for conv.0.1.weight: copying a param with shape torch.Size([960]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for conv.0.1.bias: copying a param with shape torch.Size([960]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for conv.0.1.running_mean: copying a param with shape torch.Size([960]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for conv.0.1.running_var: copying a param with shape torch.Size([960]) from checkpoint, the shape in current model is torch.Size([576]).
size mismatch for classifier.1.weight: copying a param with shape torch.Size([1280, 960]) from checkpoint, the shape in current model is torch.Size([1280]).

eval Segmentation fault

import torch
from mobilenetv3 import mobilenetv3_small

net_small = mobilenetv3_small()
net_small.load_state_dict(torch.load('mobilenetv3-small-c7eb32fe.pth'))
net_small.eval()
x = torch.randn(2,3,224,224)
net_small(x)

!!!Segmentation fault (core dumped) in line net_small(x)
torch.version '0.4.1'

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.