Code Monkey home page Code Monkey logo

gluoncv-torch's People

Contributors

sgsouham avatar stacyyang avatar zhanghang1989 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gluoncv-torch's Issues

ResNet produces error with dilation on, does not reach claimed accuracy when dilation off.

When I load using model = gcv.models.resnet50(pretrained=True) and test forwarding, error RuntimeError: size mismatch, m1: [1 x 991232], m2: [2048 x 1000] raises. I think there should be something wrong with stride / downsampling.

# gluoncv-torch resolution
torch.Size([1, 64, 56, 56])
torch.Size([1, 2048, 28, 28])
torch.Size([1, 2048, 22, 22])
torch.Size([1, 991232])
# Pytorch vision resolution
torch.Size([1, 64, 56, 56])
torch.Size([1, 2048, 7, 7])
torch.Size([1, 2048, 1, 1])
torch.Size([1, 2048])

After a quick look into the code, I thought the cause might be the dilation. So I turned off the dilation using model = gcv.models.resnet50(pretrained=True, dilated=False). This time model forwards without error, however, does not reach comparable performance as GluonCV claims.

➜  tmp git:(master) ✗ CUDA_VISIBLE_DEVICES=0 python main.py /ssd/dataset/imagenet/ --arch resnet50 --pretrained -e
=> using pre-trained model 'resnet50'
Test: [0/196]	Time 8.818 (8.818)	Loss 0.5173 (0.5173)	Acc@1 86.328 (86.328)	Acc@5 97.656 (97.656)
Test: [10/196]	Time 0.549 (1.302)	Loss 0.9599 (0.6264)	Acc@1 76.172 (83.416)	Acc@5 92.188 (96.058)
Test: [20/196]	Time 0.550 (0.944)	Loss 0.7655 (0.6439)	Acc@1 84.766 (83.147)	Acc@5 92.188 (95.778)
Test: [30/196]	Time 0.551 (0.867)	Loss 0.7689 (0.6200)	Acc@1 82.422 (84.085)	Acc@5 95.312 (95.892)
Test: [40/196]	Time 0.558 (0.823)	Loss 0.6093 (0.6584)	Acc@1 86.719 (82.793)	Acc@5 96.875 (95.846)
Test: [50/196]	Time 0.551 (0.776)	Loss 0.4676 (0.6536)	Acc@1 88.281 (82.598)	Acc@5 96.875 (96.025)
Test: [60/196]	Time 0.565 (0.748)	Loss 0.9166 (0.6706)	Acc@1 74.609 (82.185)	Acc@5 94.141 (96.126)
Test: [70/196]	Time 0.556 (0.724)	Loss 0.6710 (0.6548)	Acc@1 78.516 (82.543)	Acc@5 97.266 (96.259)
Test: [80/196]	Time 0.558 (0.709)	Loss 1.2860 (0.6754)	Acc@1 67.578 (82.205)	Acc@5 90.625 (95.964)
Test: [90/196]	Time 0.762 (0.698)	Loss 1.8590 (0.7210)	Acc@1 57.422 (81.186)	Acc@5 86.719 (95.497)
Test: [100/196]	Time 0.563 (0.685)	Loss 1.0176 (0.7670)	Acc@1 73.438 (80.171)	Acc@5 92.969 (95.042)
Test: [110/196]	Time 0.566 (0.685)	Loss 0.7850 (0.7894)	Acc@1 81.250 (79.761)	Acc@5 94.531 (94.781)
Test: [120/196]	Time 0.626 (0.686)	Loss 1.1852 (0.8062)	Acc@1 72.656 (79.513)	Acc@5 90.234 (94.544)
Test: [130/196]	Time 0.691 (0.679)	Loss 0.6243 (0.8364)	Acc@1 83.203 (78.739)	Acc@5 96.875 (94.212)
Test: [140/196]	Time 0.563 (0.676)	Loss 0.9735 (0.8516)	Acc@1 75.781 (78.405)	Acc@5 92.969 (94.066)
Test: [150/196]	Time 0.657 (0.671)	Loss 1.0451 (0.8695)	Acc@1 79.688 (78.042)	Acc@5 89.844 (93.822)
Test: [160/196]	Time 0.566 (0.665)	Loss 0.6886 (0.8843)	Acc@1 84.766 (77.717)	Acc@5 94.141 (93.592)
Test: [170/196]	Time 0.567 (0.663)	Loss 0.5897 (0.9007)	Acc@1 83.203 (77.273)	Acc@5 96.875 (93.416)
Test: [180/196]	Time 0.567 (0.658)	Loss 1.1500 (0.9158)	Acc@1 68.359 (76.895)	Acc@5 94.531 (93.269)
Test: [190/196]	Time 0.567 (0.655)	Loss 1.1336 (0.9163)	Acc@1 68.359 (76.820)	Acc@5 94.922 (93.294)
 * Acc@1 76.954 Acc@5 93.348

ImportError: cannot import name interpolate

from torch.nn.functional import interpolate
ImportError: cannot import name interpolate

Does anyone have this problem?Pytorch = 0.4.0 and python = 2.7.13
What causes it?

PyTorch Version For Saving & Loading Model

Thanks for the sharing the model.
I ran into loading model error using PyTorch 0.3.1.
I found the problem is because PyTorch model is backward compatible but not forward compatible.

  1. Just wonder which version you used for saving the model.
  2. And whether model compatible with slightly older version (0.3.1 in my case) will be available.

Thanks :)

load model error

KeyError: 'unexpected key "pretrained.conv1.1.num_batches_tracked" in state_dict'
please tell me which error for this? thank you

AttributeError: 'ResNet' object has no attribute 'copy'

When I use model.load_state_dict(pretrained_model, strict=False)to load your model,the error occurs.Then I find that the pretrained_model from pretrained_model=gcv.models.resnet101(pretrained=True) is a class gluoncvth.models.resnet.ResNet,not a dict.It also can't use pretrained_model.items() or .state.dict() to change the layers in pretrained_model.
How can I deal with these problems ?Please give me a hand.

Error(s) in loading state_dict for ResNet when deep_base=True

Hi, thanks for the great work. I have encountered an error when loading the pretrained weight for resnet-101.
RuntimeError: Error(s) in loading state_dict for ResNet: size mismatch for bn1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for bn1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for bn1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for bn1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for layer1.0.conv1.weight: copying a param with shape torch.Size([64, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([64, 128, 1, 1]). size mismatch for layer1.0.downsample.0.weight: copying a param with shape torch.Size([256, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 128, 1, 1]).

The parameter deep_base=True has been set. And there is no problem when deep_base=False .Could you help with this? Thanks!

Undefined name: 'root' in resnet.py

flake8 testing of https://github.com/zhanghang1989/gluoncv-torch on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./gluoncvth/models/resnet.py:225:45: F821 undefined name 'root'
            get_model_file('resnet18', root=root)), strict=False)
                                            ^
./gluoncvth/models/resnet.py:238:45: F821 undefined name 'root'
            get_model_file('resnet34', root=root)), strict=False)
                                            ^
2     F821 undefined name 'root'
2

model

Can you provide more models,such as modified ResNet that 7x7Conv convert to 3 3x3Conv.

Detection model

Which models are voc detection model and segmentation model?
And what will be their output?

Training Setting

Hi ! Thanks for sharing the trained model, I wonder how to reproduce this result.
For example, for ADE dataset, this training set is the same as Pytorch-Encoding repo??
What is the learning rate and crop size, batch size

How to scale cosine learning rate for small batchsize

When training ResNet on ImageNet, the GluonCV uses a batchsize of 128x8GPUs with cosine learning rate. Do you have any suggestion to scale learning rate when using a small batchsize? I tried directly scaling down learning rate by the ratio of batchsize but it did not work very well.

Thanks.

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.