Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ Models #728

Merged
merged 50 commits into from
Jun 11, 2019
Merged

C++ Models #728

merged 50 commits into from
Jun 11, 2019

Conversation

ShahriarRezghi
Copy link
Contributor

Hi @fmassa
I have implemented C++ models as discussed here. But I ran into some problems:

  • There is no kaiming initialization in C++ API of Pytorch. There is a PR for it but there hasn't been progress in the last 20 days. I have used xavier initialization right now
  • Modules in DenseNet are associated with names and are inside OrderedDict. I didn't know what to do with these so I have implemented them without names
  • I think that there is an error in inception implementation which I have reported here
  • I've implemented scipy.stats.truncnorm myself with the help of this
  • My knowledge of CMake is limited so I'm going to need a little bit of help there
  • I have partially tested the models like running random data with them and checking number of parameters to see it they match python models but I didn't find tests for python models. Shouldn't there be test units for these?

If you can help me solve these issues I will be able to finish the code.

@codecov-io
Copy link

codecov-io commented Jan 26, 2019

Codecov Report

Merging #728 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #728      +/-   ##
==========================================
+ Coverage   62.69%   62.71%   +0.01%     
==========================================
  Files          65       65              
  Lines        5080     5101      +21     
  Branches      761      765       +4     
==========================================
+ Hits         3185     3199      +14     
- Misses       1678     1680       +2     
- Partials      217      222       +5
Impacted Files Coverage Δ
torchvision/datasets/utils.py 58.51% <0%> (-2.97%) ⬇️
torchvision/models/mobilenet.py 89.7% <0%> (-2.61%) ⬇️
torchvision/models/densenet.py 86.79% <0%> (+1.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa32c93...a6873d9. Read the comment docs.

@soumith
Copy link
Member

soumith commented Jan 26, 2019

this is really great, thanks a lot for the PR.
@fmassa or others will help out on the cmake and other bits so that you can get this to completion :)

@ShahriarRezghi
Copy link
Contributor Author

Thanks @soumith

@ShahriarRezghi
Copy link
Contributor Author

Hi @soumith
It has been two weeks since I opened this PR and no progress has been made. I would like to finish this while I have some free time on my hand and kaiming initialization is almost done so perhaps we can work on the other issues and when kaiming initialization is done I'll change the code accordingly.

@soumith
Copy link
Member

soumith commented Feb 9, 2019

it's our fault for letting this drop off. I pinged @goldsborough @yf225 and @fmassa , and we'll review and help on this early next week, i.e. monday / tuesday.
Thanks a lot for bumping it.

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Thanks a lot for the PR and sorry for the long time to review.

I went over the implementation of the models, by comparing them line by line with the Python versions, and they look good to me (minus some comments in the code).

There are a few orthogonal points that I'd like to make regarding the C++ style:

  • there are tabs everywhere in the implementation. Can we replace those with 2 spaces?
  • do we want to enforce some style guidelines?
  • I think it would be good to have the pre-trained weights from Python to be converted to C++, so that the users can just download them and start using it right away. @goldsborough what's the recommended format in this case, and is there a simple way of achieving this?
  • it would be great to have some kind of tests that ensure that the outputs are the same as their corresponding Python version. A potential way of handling this would be to forward the same tensor (a serialized image maybe?), given the same initialization (a pre-trained model maybe?) and assert that the output tensor is the same.

Thoughts?

torchvision/csrc/models/densenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/densenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/densenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/inception.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/inception.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/squeezenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/squeezenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/vgg.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/vgg.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/vgg.cpp Outdated Show resolved Hide resolved
@ShahriarRezghi
Copy link
Contributor Author

Hi @fmassa

regarding comments: The comments that are currently present are copied form python code. What is wrong with them?

regarding tabs and guidelines: I like tabs instead of spaces and I've made myself a custom clang-format style based on google with tabs and breaks before the brace that begins blocks. But I checked and Pytorch is apparently using google style so I'll change it.

regarding testing: once we manage to add pretrained models to C++ models testing it the way that you said will be easy. This can be C++ API's tests and every time python API changes these tests will fail indicating that the code needs to be changed.

@goldsborough
Copy link

Please use https://github.com/pytorch/pytorch/blob/master/.clang-format to format your code.

@fmassa
Copy link
Member

fmassa commented Feb 12, 2019

@ShahriarSS

regarding comments: The comments that are currently present are copied form python code. What is wrong with them?

Nothing wrong, I left comments in the code, that's what I meant :-)

regarding testing: once we manage to add pretrained models to C++ models testing it the way that you said will be easy. This can be C++ API's tests and every time python API changes these tests will fail indicating that the code needs to be changed.

Yes. This will also mean adding tests to the python models, which I can do later as well.

Copy link

@goldsborough goldsborough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good overall! My main request is to remove the custom MaxPool and ReLU modules and use torch::nn::Functional instead -- I've left inline comments about this

torchvision/csrc/models/alexnet.h Outdated Show resolved Hide resolved
torchvision/csrc/models/densenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/densenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/densenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/modelsimpl.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/modelsimpl.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/resnet.h Outdated Show resolved Hide resolved
torchvision/csrc/models/squeezenet.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/vgg.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/vgg.cpp Show resolved Hide resolved
@CDitzel
Copy link

CDitzel commented Feb 13, 2019

isn't the explicit call to a modules forward method unnecessary since the operator overloading of the call op? removing those would make the code both less verbose and more pythonish...

@ShahriarRezghi
Copy link
Contributor Author

Hi @goldsborough
The problem with relu_ is its argument which is a reference. There is another problem that is in using torch::nn::Functional with adaptive_avg_pool2d that fails at run-time. I looked into it and the problem is with the second arguement IntArrayRef. When I change it to ExpandingArray<2> it works fine. I wrapped relu and adaptive_avg_pool2d with functions and the code works for now until these issues are resolved.

@goldsborough
Copy link

I'll look into the adaptive_avg_pool2d issue. Can you use torch::relu instead of the inplace torch::relu_?

@goldsborough
Copy link

As far default arguments and nn::Functional -- that's not possible from a C++ perspective unfortunately, I verified that yesterday. However, to avoid having to write out the default arguments, you could create a wrapper function and pass that to Functional. Otherwise looks good so far.

@ShahriarRezghi
Copy link
Contributor Author

ShahriarRezghi commented Feb 14, 2019

@goldsborough
I didn't look at the implementation but shouldn't relu_ be faster than relu or is the data copied regardless because of autograd?
And I'll write a function for maxpool_2d to use where only kernel and stride are passed and use torch::maxpool_2d for the rest.

@ShahriarRezghi
Copy link
Contributor Author

ShahriarRezghi commented Feb 14, 2019

Remaining tasks:

  • Adding pre-trained weights
  • Writing tests
  • Adding kaiming initializer

@ShahriarRezghi
Copy link
Contributor Author

Hi @goldsborough
I replaced xavier with kaiming. Can we discuss pre-trained weights? Once we have pre-trained weights I can write the tests and the models will be ready to use.

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might still be a few differences left in the initialization

torchvision/csrc/models/vgg.cpp Outdated Show resolved Hide resolved
torchvision/csrc/models/resnet.h Outdated Show resolved Hide resolved
@fmassa
Copy link
Member

fmassa commented Feb 19, 2019

@ShahriarSS about pre-trained weights, I think we should convert straightaway the models from torchvision.

@goldsborough @yf225 what would be the recommended way here to convert a state_dict from Python to C++?

@yf225
Copy link

yf225 commented Feb 19, 2019

@fmassa I looked through the C++ API, and saving the torchvision models as JIT models and loading them into C++ might be the best way to share models between Python and C++ (https://pytorch.org/tutorials/advanced/cpp_export.html). Would it be feasible to do?

@yf225
Copy link

yf225 commented Feb 19, 2019

@fmassa @ShahriarSS I think this is the recommended way to share pre-trained weights from Python to C++:

  1. Convert Python model to TorchScript, and save the model to file using model.save(filename).
  2. Create a C++ frontend model with the exact same model structure.
  3. Load the parameters and buffers from TorchScript model to C++ frontend model using torch::load(cpp_module, file_path_to_torchscript_model)

This is a minimal example:
JIT model:

import torch
class Model(torch.jit.ScriptModule):
    def __init__(self):
        super(Model, self).__init__()
        self.linear = torch.nn.Linear(2, 2)

model = Model()
print(model.linear.weight)  # For comparison
model.save('model1.pt')

C++ frontend model:

struct Net : torch::nn::Module {
  Net() {
    linear = register_module("linear", torch::nn::Linear(2, 2));  // Exactly match the Python model
  }
  torch::nn::Linear linear{nullptr};
};

Load parameters of JIT model into C++ frontend model:

int main(int argc, const char* argv[]) {
    auto module = std::make_shared<Net>();
    std::cout << module->linear->named_parameters()["weight"] << "\n";  // before loading pre-trained params
    torch::load(module, argv[1]);
    std::cout << module->linear->named_parameters()["weight"] << "\n";  // after loading pre-trained params

    return 0;
}

@ShahriarRezghi
Copy link
Contributor Author

ShahriarRezghi commented Feb 19, 2019

I was thinking of the same method. I think that the models that I have written match the structure of the python models but I'm not sure. I will try this and If I run into any problem I'll inform you.
@fmassa this code must be separate from the API. The pre-trained models should be generated only once and downloaded when needed. Is this correct?

@ShahriarRezghi
Copy link
Contributor Author

ShahriarRezghi commented Feb 21, 2019

@yf225 @fmassa
I wrote the code to save models in python and load and save them in C++ but there is a problem. I looks like my models are compatible with the ones from python and I am able to load alexnet and vggs without batch norm in C++ but the models that contain batch norm fail to load. here is the output:

terminate called after throwing an instance of 'c10::Error'
  what():  No such serialized tensor 'running_variance' (read at /home/shahriar/Build/pytorch/torch/csrc/api/src/serialize/input-archive.cpp:27)
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x85 (0x7f2d92d32f95 in /usr/local/lib/libc10.so)
frame #1: torch::serialize::InputArchive::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, at::Tensor&, bool) + 0xdeb (0x7f2d938551ab in /usr/local/lib/libtorch.so.1)
frame #2: torch::nn::Module::load(torch::serialize::InputArchive&) + 0x98 (0x7f2d9381cd08 in /usr/local/lib/libtorch.so.1)
frame #3: torch::nn::Module::load(torch::serialize::InputArchive&) + 0xf9 (0x7f2d9381cd69 in /usr/local/lib/libtorch.so.1)
frame #4: torch::nn::Module::load(torch::serialize::InputArchive&) + 0xf9 (0x7f2d9381cd69 in /usr/local/lib/libtorch.so.1)
frame #5: torch::nn::operator>>(torch::serialize::InputArchive&, std::shared_ptr<torch::nn::Module> const&) + 0x32 (0x7f2d9381c7b2 in /usr/local/lib/libtorch.so.1)
frame #6: <unknown function> + 0x2b16c (0x5645f4d1916c in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
frame #7: <unknown function> + 0x27a3c (0x5645f4d15a3c in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
frame #8: <unknown function> + 0x2165c (0x5645f4d0f65c in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
frame #9: <unknown function> + 0x1540b (0x5645f4d0340b in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
frame #10: __libc_start_main + 0xf3 (0x7f2d051dd223 in /usr/lib/libc.so.6)
frame #11: <unknown function> + 0x1381e (0x5645f4d0181e in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)

I checked and BatchNorm only has weight and bias parameters but there is no "running_variance". I can push the code that converts the models if you want to.

@yf225
Copy link

yf225 commented Feb 21, 2019

@ShahriarSS

The Python BatchNorm has running_var which should be mapped to C++ BatchNorm's running_variance. We should rename C++ BatchNorm's running_variance to running_var to make this work seamlessly. I opened a PR for it: pytorch/pytorch#17371.

facebook-github-bot pushed a commit to pytorch/pytorch that referenced this pull request Feb 22, 2019
Summary:
Currently there is a mismatch in naming between Python BatchNorm `running_var` and C++ BatchNorm `running_variance`, which causes JIT model parameters loading to fail (pytorch/vision#728 (comment)):
```
terminate called after throwing an instance of 'c10::Error'
  what():  No such serialized tensor 'running_variance' (read at /home/shahriar/Build/pytorch/torch/csrc/api/src/serialize/input-archive.cpp:27)
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x85 (0x7f2d92d32f95 in /usr/local/lib/libc10.so)
frame #1: torch::serialize::InputArchive::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, at::Tensor&, bool) + 0xdeb (0x7f2d938551ab in /usr/local/lib/libtorch.so.1)
frame #2: torch::nn::Module::load(torch::serialize::InputArchive&) + 0x98 (0x7f2d9381cd08 in /usr/local/lib/libtorch.so.1)
frame #3: torch::nn::Module::load(torch::serialize::InputArchive&) + 0xf9 (0x7f2d9381cd69 in /usr/local/lib/libtorch.so.1)
frame #4: torch::nn::Module::load(torch::serialize::InputArchive&) + 0xf9 (0x7f2d9381cd69 in /usr/local/lib/libtorch.so.1)
frame #5: torch::nn::operator>>(torch::serialize::InputArchive&, std::shared_ptr<torch::nn::Module> const&) + 0x32 (0x7f2d9381c7b2 in /usr/local/lib/libtorch.so.1)
frame #6: <unknown function> + 0x2b16c (0x5645f4d1916c in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
frame #7: <unknown function> + 0x27a3c (0x5645f4d15a3c in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
frame #8: <unknown function> + 0x2165c (0x5645f4d0f65c in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
frame #9: <unknown function> + 0x1540b (0x5645f4d0340b in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
frame #10: __libc_start_main + 0xf3 (0x7f2d051dd223 in /usr/lib/libc.so.6)
frame #11: <unknown function> + 0x1381e (0x5645f4d0181e in /home/shahriar/Projects/CXX/build-TorchVisionTest-Desktop_Qt_5_12_1_GCC_64bit-Debug/TorchVisionTest)
```
Renaming C++ BatchNorm `running_variance` to `running_var` should fix this problem.

This is a BC-breaking change, but it should be easy for end user to rename `running_variance` to `running_var` in their call sites.
Pull Request resolved: #17371

Reviewed By: goldsborough

Differential Revision: D14172775

Pulled By: yf225

fbshipit-source-id: b9d3729ec79272a8084269756f28a8f7c4dd16b6
@yf225
Copy link

yf225 commented Feb 22, 2019

@ShahriarSS The PR pytorch/pytorch#17371 is merged and the libtorch nightly build in the next few days should fix the BatchNorm running_variance problem.

@ShahriarRezghi
Copy link
Contributor Author

@yf225 I will compile pytorch from source to get it faster

@ShahriarRezghi
Copy link
Contributor Author

Hi @yf225
All of the models except DenseNet can be loaded and saved without modification. The names of the modules in DenseNet are modified. DenseNet121 looks like this:

features.conv0.weight
features.norm0.weight
features.norm0.bias
features.norm0.running_mean
features.norm0.running_var
features.norm0.num_batches_tracked
features.denseblock1.denselayer1.norm1.weight
features.denseblock1.denselayer1.norm1.bias
features.denseblock1.denselayer1.norm1.running_mean
features.denseblock1.denselayer1.norm1.running_var
features.denseblock1.denselayer1.norm1.num_batches_tracked
features.denseblock1.denselayer1.conv1.weight
features.denseblock1.denselayer1.norm2.weight
features.denseblock1.denselayer1.norm2.bias
features.denseblock1.denselayer1.norm2.running_mean
features.denseblock1.denselayer1.norm2.running_var
features.denseblock1.denselayer1.norm2.num_batches_tracked
features.denseblock1.denselayer1.conv2.weight
features.denseblock1.denselayer2.norm1.weight
features.denseblock1.denselayer2.norm1.bias
features.denseblock1.denselayer2.norm1.running_mean
features.denseblock1.denselayer2.norm1.running_var
features.denseblock1.denselayer2.norm1.num_batches_tracked
features.denseblock1.denselayer2.conv1.weight
features.denseblock1.denselayer2.norm2.weight
features.denseblock1.denselayer2.norm2.bias
features.denseblock1.denselayer2.norm2.running_mean
features.denseblock1.denselayer2.norm2.running_var
features.denseblock1.denselayer2.norm2.num_batches_tracked
features.denseblock1.denselayer2.conv2.weight
features.denseblock1.denselayer3.norm1.weight
features.denseblock1.denselayer3.norm1.bias
features.denseblock1.denselayer3.norm1.running_mean
features.denseblock1.denselayer3.norm1.running_var
features.denseblock1.denselayer3.norm1.num_batches_tracked
features.denseblock1.denselayer3.conv1.weight
features.denseblock1.denselayer3.norm2.weight
features.denseblock1.denselayer3.norm2.bias
features.denseblock1.denselayer3.norm2.running_mean
features.denseblock1.denselayer3.norm2.running_var
features.denseblock1.denselayer3.norm2.num_batches_tracked
features.denseblock1.denselayer3.conv2.weight
features.denseblock1.denselayer4.norm1.weight
features.denseblock1.denselayer4.norm1.bias
features.denseblock1.denselayer4.norm1.running_mean
features.denseblock1.denselayer4.norm1.running_var
features.denseblock1.denselayer4.norm1.num_batches_tracked
features.denseblock1.denselayer4.conv1.weight
features.denseblock1.denselayer4.norm2.weight
features.denseblock1.denselayer4.norm2.bias
features.denseblock1.denselayer4.norm2.running_mean
features.denseblock1.denselayer4.norm2.running_var
features.denseblock1.denselayer4.norm2.num_batches_tracked
features.denseblock1.denselayer4.conv2.weight
features.denseblock1.denselayer5.norm1.weight
features.denseblock1.denselayer5.norm1.bias
features.denseblock1.denselayer5.norm1.running_mean
features.denseblock1.denselayer5.norm1.running_var
features.denseblock1.denselayer5.norm1.num_batches_tracked
features.denseblock1.denselayer5.conv1.weight
features.denseblock1.denselayer5.norm2.weight
features.denseblock1.denselayer5.norm2.bias
features.denseblock1.denselayer5.norm2.running_mean
features.denseblock1.denselayer5.norm2.running_var
features.denseblock1.denselayer5.norm2.num_batches_tracked
features.denseblock1.denselayer5.conv2.weight
features.denseblock1.denselayer6.norm1.weight
features.denseblock1.denselayer6.norm1.bias
features.denseblock1.denselayer6.norm1.running_mean
features.denseblock1.denselayer6.norm1.running_var
features.denseblock1.denselayer6.norm1.num_batches_tracked
features.denseblock1.denselayer6.conv1.weight
features.denseblock1.denselayer6.norm2.weight
features.denseblock1.denselayer6.norm2.bias
features.denseblock1.denselayer6.norm2.running_mean
features.denseblock1.denselayer6.norm2.running_var
features.denseblock1.denselayer6.norm2.num_batches_tracked
features.denseblock1.denselayer6.conv2.weight
features.transition1.norm.weight
features.transition1.norm.bias
features.transition1.norm.running_mean
features.transition1.norm.running_var
features.transition1.norm.num_batches_tracked
features.transition1.conv.weight
features.denseblock2.denselayer1.norm1.weight
features.denseblock2.denselayer1.norm1.bias
features.denseblock2.denselayer1.norm1.running_mean
features.denseblock2.denselayer1.norm1.running_var
features.denseblock2.denselayer1.norm1.num_batches_tracked
features.denseblock2.denselayer1.conv1.weight
features.denseblock2.denselayer1.norm2.weight
features.denseblock2.denselayer1.norm2.bias
features.denseblock2.denselayer1.norm2.running_mean
features.denseblock2.denselayer1.norm2.running_var
features.denseblock2.denselayer1.norm2.num_batches_tracked
features.denseblock2.denselayer1.conv2.weight
features.denseblock2.denselayer2.norm1.weight
features.denseblock2.denselayer2.norm1.bias
features.denseblock2.denselayer2.norm1.running_mean
features.denseblock2.denselayer2.norm1.running_var
features.denseblock2.denselayer2.norm1.num_batches_tracked
features.denseblock2.denselayer2.conv1.weight
features.denseblock2.denselayer2.norm2.weight
features.denseblock2.denselayer2.norm2.bias
features.denseblock2.denselayer2.norm2.running_mean
features.denseblock2.denselayer2.norm2.running_var
features.denseblock2.denselayer2.norm2.num_batches_tracked
features.denseblock2.denselayer2.conv2.weight
features.denseblock2.denselayer3.norm1.weight
features.denseblock2.denselayer3.norm1.bias
features.denseblock2.denselayer3.norm1.running_mean
features.denseblock2.denselayer3.norm1.running_var
features.denseblock2.denselayer3.norm1.num_batches_tracked
features.denseblock2.denselayer3.conv1.weight
features.denseblock2.denselayer3.norm2.weight
features.denseblock2.denselayer3.norm2.bias
features.denseblock2.denselayer3.norm2.running_mean
features.denseblock2.denselayer3.norm2.running_var
features.denseblock2.denselayer3.norm2.num_batches_tracked
features.denseblock2.denselayer3.conv2.weight
features.denseblock2.denselayer4.norm1.weight
features.denseblock2.denselayer4.norm1.bias
features.denseblock2.denselayer4.norm1.running_mean
features.denseblock2.denselayer4.norm1.running_var
features.denseblock2.denselayer4.norm1.num_batches_tracked
features.denseblock2.denselayer4.conv1.weight
features.denseblock2.denselayer4.norm2.weight
features.denseblock2.denselayer4.norm2.bias
features.denseblock2.denselayer4.norm2.running_mean
features.denseblock2.denselayer4.norm2.running_var
features.denseblock2.denselayer4.norm2.num_batches_tracked
features.denseblock2.denselayer4.conv2.weight
features.denseblock2.denselayer5.norm1.weight
features.denseblock2.denselayer5.norm1.bias
features.denseblock2.denselayer5.norm1.running_mean
features.denseblock2.denselayer5.norm1.running_var
features.denseblock2.denselayer5.norm1.num_batches_tracked
features.denseblock2.denselayer5.conv1.weight
features.denseblock2.denselayer5.norm2.weight
features.denseblock2.denselayer5.norm2.bias
features.denseblock2.denselayer5.norm2.running_mean
features.denseblock2.denselayer5.norm2.running_var
features.denseblock2.denselayer5.norm2.num_batches_tracked
features.denseblock2.denselayer5.conv2.weight
features.denseblock2.denselayer6.norm1.weight
features.denseblock2.denselayer6.norm1.bias
features.denseblock2.denselayer6.norm1.running_mean
features.denseblock2.denselayer6.norm1.running_var
features.denseblock2.denselayer6.norm1.num_batches_tracked
features.denseblock2.denselayer6.conv1.weight
features.denseblock2.denselayer6.norm2.weight
features.denseblock2.denselayer6.norm2.bias
features.denseblock2.denselayer6.norm2.running_mean
features.denseblock2.denselayer6.norm2.running_var
features.denseblock2.denselayer6.norm2.num_batches_tracked
features.denseblock2.denselayer6.conv2.weight
features.denseblock2.denselayer7.norm1.weight
features.denseblock2.denselayer7.norm1.bias
features.denseblock2.denselayer7.norm1.running_mean
features.denseblock2.denselayer7.norm1.running_var
features.denseblock2.denselayer7.norm1.num_batches_tracked
features.denseblock2.denselayer7.conv1.weight
features.denseblock2.denselayer7.norm2.weight
features.denseblock2.denselayer7.norm2.bias
features.denseblock2.denselayer7.norm2.running_mean
features.denseblock2.denselayer7.norm2.running_var
features.denseblock2.denselayer7.norm2.num_batches_tracked
features.denseblock2.denselayer7.conv2.weight
features.denseblock2.denselayer8.norm1.weight
features.denseblock2.denselayer8.norm1.bias
features.denseblock2.denselayer8.norm1.running_mean
features.denseblock2.denselayer8.norm1.running_var
features.denseblock2.denselayer8.norm1.num_batches_tracked
features.denseblock2.denselayer8.conv1.weight
features.denseblock2.denselayer8.norm2.weight
features.denseblock2.denselayer8.norm2.bias
features.denseblock2.denselayer8.norm2.running_mean
features.denseblock2.denselayer8.norm2.running_var
features.denseblock2.denselayer8.norm2.num_batches_tracked
features.denseblock2.denselayer8.conv2.weight
features.denseblock2.denselayer9.norm1.weight
features.denseblock2.denselayer9.norm1.bias
features.denseblock2.denselayer9.norm1.running_mean
features.denseblock2.denselayer9.norm1.running_var
features.denseblock2.denselayer9.norm1.num_batches_tracked
features.denseblock2.denselayer9.conv1.weight
features.denseblock2.denselayer9.norm2.weight
features.denseblock2.denselayer9.norm2.bias
features.denseblock2.denselayer9.norm2.running_mean
features.denseblock2.denselayer9.norm2.running_var
features.denseblock2.denselayer9.norm2.num_batches_tracked
features.denseblock2.denselayer9.conv2.weight
features.denseblock2.denselayer10.norm1.weight
features.denseblock2.denselayer10.norm1.bias
features.denseblock2.denselayer10.norm1.running_mean
features.denseblock2.denselayer10.norm1.running_var
features.denseblock2.denselayer10.norm1.num_batches_tracked
features.denseblock2.denselayer10.conv1.weight
features.denseblock2.denselayer10.norm2.weight
features.denseblock2.denselayer10.norm2.bias
features.denseblock2.denselayer10.norm2.running_mean
features.denseblock2.denselayer10.norm2.running_var
features.denseblock2.denselayer10.norm2.num_batches_tracked
features.denseblock2.denselayer10.conv2.weight
features.denseblock2.denselayer11.norm1.weight
features.denseblock2.denselayer11.norm1.bias
features.denseblock2.denselayer11.norm1.running_mean
features.denseblock2.denselayer11.norm1.running_var
features.denseblock2.denselayer11.norm1.num_batches_tracked
features.denseblock2.denselayer11.conv1.weight
features.denseblock2.denselayer11.norm2.weight
features.denseblock2.denselayer11.norm2.bias
features.denseblock2.denselayer11.norm2.running_mean
features.denseblock2.denselayer11.norm2.running_var
features.denseblock2.denselayer11.norm2.num_batches_tracked
features.denseblock2.denselayer11.conv2.weight
features.denseblock2.denselayer12.norm1.weight
features.denseblock2.denselayer12.norm1.bias
features.denseblock2.denselayer12.norm1.running_mean
features.denseblock2.denselayer12.norm1.running_var
features.denseblock2.denselayer12.norm1.num_batches_tracked
features.denseblock2.denselayer12.conv1.weight
features.denseblock2.denselayer12.norm2.weight
features.denseblock2.denselayer12.norm2.bias
features.denseblock2.denselayer12.norm2.running_mean
features.denseblock2.denselayer12.norm2.running_var
features.denseblock2.denselayer12.norm2.num_batches_tracked
features.denseblock2.denselayer12.conv2.weight
features.transition2.norm.weight
features.transition2.norm.bias
features.transition2.norm.running_mean
features.transition2.norm.running_var
features.transition2.norm.num_batches_tracked
features.transition2.conv.weight
features.denseblock3.denselayer1.norm1.weight
features.denseblock3.denselayer1.norm1.bias
features.denseblock3.denselayer1.norm1.running_mean
features.denseblock3.denselayer1.norm1.running_var
features.denseblock3.denselayer1.norm1.num_batches_tracked
features.denseblock3.denselayer1.conv1.weight
features.denseblock3.denselayer1.norm2.weight
features.denseblock3.denselayer1.norm2.bias
features.denseblock3.denselayer1.norm2.running_mean
features.denseblock3.denselayer1.norm2.running_var
features.denseblock3.denselayer1.norm2.num_batches_tracked
features.denseblock3.denselayer1.conv2.weight
features.denseblock3.denselayer2.norm1.weight
features.denseblock3.denselayer2.norm1.bias
features.denseblock3.denselayer2.norm1.running_mean
features.denseblock3.denselayer2.norm1.running_var
features.denseblock3.denselayer2.norm1.num_batches_tracked
features.denseblock3.denselayer2.conv1.weight
features.denseblock3.denselayer2.norm2.weight
features.denseblock3.denselayer2.norm2.bias
features.denseblock3.denselayer2.norm2.running_mean
features.denseblock3.denselayer2.norm2.running_var
features.denseblock3.denselayer2.norm2.num_batches_tracked
features.denseblock3.denselayer2.conv2.weight
features.denseblock3.denselayer3.norm1.weight
features.denseblock3.denselayer3.norm1.bias
features.denseblock3.denselayer3.norm1.running_mean
features.denseblock3.denselayer3.norm1.running_var
features.denseblock3.denselayer3.norm1.num_batches_tracked
features.denseblock3.denselayer3.conv1.weight
features.denseblock3.denselayer3.norm2.weight
features.denseblock3.denselayer3.norm2.bias
features.denseblock3.denselayer3.norm2.running_mean
features.denseblock3.denselayer3.norm2.running_var
features.denseblock3.denselayer3.norm2.num_batches_tracked
features.denseblock3.denselayer3.conv2.weight
features.denseblock3.denselayer4.norm1.weight
features.denseblock3.denselayer4.norm1.bias
features.denseblock3.denselayer4.norm1.running_mean
features.denseblock3.denselayer4.norm1.running_var
features.denseblock3.denselayer4.norm1.num_batches_tracked
features.denseblock3.denselayer4.conv1.weight
features.denseblock3.denselayer4.norm2.weight
features.denseblock3.denselayer4.norm2.bias
features.denseblock3.denselayer4.norm2.running_mean
features.denseblock3.denselayer4.norm2.running_var
features.denseblock3.denselayer4.norm2.num_batches_tracked
features.denseblock3.denselayer4.conv2.weight
features.denseblock3.denselayer5.norm1.weight
features.denseblock3.denselayer5.norm1.bias
features.denseblock3.denselayer5.norm1.running_mean
features.denseblock3.denselayer5.norm1.running_var
features.denseblock3.denselayer5.norm1.num_batches_tracked
features.denseblock3.denselayer5.conv1.weight
features.denseblock3.denselayer5.norm2.weight
features.denseblock3.denselayer5.norm2.bias
features.denseblock3.denselayer5.norm2.running_mean
features.denseblock3.denselayer5.norm2.running_var
features.denseblock3.denselayer5.norm2.num_batches_tracked
features.denseblock3.denselayer5.conv2.weight
features.denseblock3.denselayer6.norm1.weight
features.denseblock3.denselayer6.norm1.bias
features.denseblock3.denselayer6.norm1.running_mean
features.denseblock3.denselayer6.norm1.running_var
features.denseblock3.denselayer6.norm1.num_batches_tracked
features.denseblock3.denselayer6.conv1.weight
features.denseblock3.denselayer6.norm2.weight
features.denseblock3.denselayer6.norm2.bias
features.denseblock3.denselayer6.norm2.running_mean
features.denseblock3.denselayer6.norm2.running_var
features.denseblock3.denselayer6.norm2.num_batches_tracked
features.denseblock3.denselayer6.conv2.weight
features.denseblock3.denselayer7.norm1.weight
features.denseblock3.denselayer7.norm1.bias
features.denseblock3.denselayer7.norm1.running_mean
features.denseblock3.denselayer7.norm1.running_var
features.denseblock3.denselayer7.norm1.num_batches_tracked
features.denseblock3.denselayer7.conv1.weight
features.denseblock3.denselayer7.norm2.weight
features.denseblock3.denselayer7.norm2.bias
features.denseblock3.denselayer7.norm2.running_mean
features.denseblock3.denselayer7.norm2.running_var
features.denseblock3.denselayer7.norm2.num_batches_tracked
features.denseblock3.denselayer7.conv2.weight
features.denseblock3.denselayer8.norm1.weight
features.denseblock3.denselayer8.norm1.bias
features.denseblock3.denselayer8.norm1.running_mean
features.denseblock3.denselayer8.norm1.running_var
features.denseblock3.denselayer8.norm1.num_batches_tracked
features.denseblock3.denselayer8.conv1.weight
features.denseblock3.denselayer8.norm2.weight
features.denseblock3.denselayer8.norm2.bias
features.denseblock3.denselayer8.norm2.running_mean
features.denseblock3.denselayer8.norm2.running_var
features.denseblock3.denselayer8.norm2.num_batches_tracked
features.denseblock3.denselayer8.conv2.weight
features.denseblock3.denselayer9.norm1.weight
features.denseblock3.denselayer9.norm1.bias
features.denseblock3.denselayer9.norm1.running_mean
features.denseblock3.denselayer9.norm1.running_var
features.denseblock3.denselayer9.norm1.num_batches_tracked
features.denseblock3.denselayer9.conv1.weight
features.denseblock3.denselayer9.norm2.weight
features.denseblock3.denselayer9.norm2.bias
features.denseblock3.denselayer9.norm2.running_mean
features.denseblock3.denselayer9.norm2.running_var
features.denseblock3.denselayer9.norm2.num_batches_tracked
features.denseblock3.denselayer9.conv2.weight
features.denseblock3.denselayer10.norm1.weight
features.denseblock3.denselayer10.norm1.bias
features.denseblock3.denselayer10.norm1.running_mean
features.denseblock3.denselayer10.norm1.running_var
features.denseblock3.denselayer10.norm1.num_batches_tracked
features.denseblock3.denselayer10.conv1.weight
features.denseblock3.denselayer10.norm2.weight
features.denseblock3.denselayer10.norm2.bias
features.denseblock3.denselayer10.norm2.running_mean
features.denseblock3.denselayer10.norm2.running_var
features.denseblock3.denselayer10.norm2.num_batches_tracked
features.denseblock3.denselayer10.conv2.weight
features.denseblock3.denselayer11.norm1.weight
features.denseblock3.denselayer11.norm1.bias
features.denseblock3.denselayer11.norm1.running_mean
features.denseblock3.denselayer11.norm1.running_var
features.denseblock3.denselayer11.norm1.num_batches_tracked
features.denseblock3.denselayer11.conv1.weight
features.denseblock3.denselayer11.norm2.weight
features.denseblock3.denselayer11.norm2.bias
features.denseblock3.denselayer11.norm2.running_mean
features.denseblock3.denselayer11.norm2.running_var
features.denseblock3.denselayer11.norm2.num_batches_tracked
features.denseblock3.denselayer11.conv2.weight
features.denseblock3.denselayer12.norm1.weight
features.denseblock3.denselayer12.norm1.bias
features.denseblock3.denselayer12.norm1.running_mean
features.denseblock3.denselayer12.norm1.running_var
features.denseblock3.denselayer12.norm1.num_batches_tracked
features.denseblock3.denselayer12.conv1.weight
features.denseblock3.denselayer12.norm2.weight
features.denseblock3.denselayer12.norm2.bias
features.denseblock3.denselayer12.norm2.running_mean
features.denseblock3.denselayer12.norm2.running_var
features.denseblock3.denselayer12.norm2.num_batches_tracked
features.denseblock3.denselayer12.conv2.weight
features.denseblock3.denselayer13.norm1.weight
features.denseblock3.denselayer13.norm1.bias
features.denseblock3.denselayer13.norm1.running_mean
features.denseblock3.denselayer13.norm1.running_var
features.denseblock3.denselayer13.norm1.num_batches_tracked
features.denseblock3.denselayer13.conv1.weight
features.denseblock3.denselayer13.norm2.weight
features.denseblock3.denselayer13.norm2.bias
features.denseblock3.denselayer13.norm2.running_mean
features.denseblock3.denselayer13.norm2.running_var
features.denseblock3.denselayer13.norm2.num_batches_tracked
features.denseblock3.denselayer13.conv2.weight
features.denseblock3.denselayer14.norm1.weight
features.denseblock3.denselayer14.norm1.bias
features.denseblock3.denselayer14.norm1.running_mean
features.denseblock3.denselayer14.norm1.running_var
features.denseblock3.denselayer14.norm1.num_batches_tracked
features.denseblock3.denselayer14.conv1.weight
features.denseblock3.denselayer14.norm2.weight
features.denseblock3.denselayer14.norm2.bias
features.denseblock3.denselayer14.norm2.running_mean
features.denseblock3.denselayer14.norm2.running_var
features.denseblock3.denselayer14.norm2.num_batches_tracked
features.denseblock3.denselayer14.conv2.weight
features.denseblock3.denselayer15.norm1.weight
features.denseblock3.denselayer15.norm1.bias
features.denseblock3.denselayer15.norm1.running_mean
features.denseblock3.denselayer15.norm1.running_var
features.denseblock3.denselayer15.norm1.num_batches_tracked
features.denseblock3.denselayer15.conv1.weight
features.denseblock3.denselayer15.norm2.weight
features.denseblock3.denselayer15.norm2.bias
features.denseblock3.denselayer15.norm2.running_mean
features.denseblock3.denselayer15.norm2.running_var
features.denseblock3.denselayer15.norm2.num_batches_tracked
features.denseblock3.denselayer15.conv2.weight
features.denseblock3.denselayer16.norm1.weight
features.denseblock3.denselayer16.norm1.bias
features.denseblock3.denselayer16.norm1.running_mean
features.denseblock3.denselayer16.norm1.running_var
features.denseblock3.denselayer16.norm1.num_batches_tracked
features.denseblock3.denselayer16.conv1.weight
features.denseblock3.denselayer16.norm2.weight
features.denseblock3.denselayer16.norm2.bias
features.denseblock3.denselayer16.norm2.running_mean
features.denseblock3.denselayer16.norm2.running_var
features.denseblock3.denselayer16.norm2.num_batches_tracked
features.denseblock3.denselayer16.conv2.weight
features.denseblock3.denselayer17.norm1.weight
features.denseblock3.denselayer17.norm1.bias
features.denseblock3.denselayer17.norm1.running_mean
features.denseblock3.denselayer17.norm1.running_var
features.denseblock3.denselayer17.norm1.num_batches_tracked
features.denseblock3.denselayer17.conv1.weight
features.denseblock3.denselayer17.norm2.weight
features.denseblock3.denselayer17.norm2.bias
features.denseblock3.denselayer17.norm2.running_mean
features.denseblock3.denselayer17.norm2.running_var
features.denseblock3.denselayer17.norm2.num_batches_tracked
features.denseblock3.denselayer17.conv2.weight
features.denseblock3.denselayer18.norm1.weight
features.denseblock3.denselayer18.norm1.bias
features.denseblock3.denselayer18.norm1.running_mean
features.denseblock3.denselayer18.norm1.running_var
features.denseblock3.denselayer18.norm1.num_batches_tracked
features.denseblock3.denselayer18.conv1.weight
features.denseblock3.denselayer18.norm2.weight
features.denseblock3.denselayer18.norm2.bias
features.denseblock3.denselayer18.norm2.running_mean
features.denseblock3.denselayer18.norm2.running_var
features.denseblock3.denselayer18.norm2.num_batches_tracked
features.denseblock3.denselayer18.conv2.weight
features.denseblock3.denselayer19.norm1.weight
features.denseblock3.denselayer19.norm1.bias
features.denseblock3.denselayer19.norm1.running_mean
features.denseblock3.denselayer19.norm1.running_var
features.denseblock3.denselayer19.norm1.num_batches_tracked
features.denseblock3.denselayer19.conv1.weight
features.denseblock3.denselayer19.norm2.weight
features.denseblock3.denselayer19.norm2.bias
features.denseblock3.denselayer19.norm2.running_mean
features.denseblock3.denselayer19.norm2.running_var
features.denseblock3.denselayer19.norm2.num_batches_tracked
features.denseblock3.denselayer19.conv2.weight
features.denseblock3.denselayer20.norm1.weight
features.denseblock3.denselayer20.norm1.bias
features.denseblock3.denselayer20.norm1.running_mean
features.denseblock3.denselayer20.norm1.running_var
features.denseblock3.denselayer20.norm1.num_batches_tracked
features.denseblock3.denselayer20.conv1.weight
features.denseblock3.denselayer20.norm2.weight
features.denseblock3.denselayer20.norm2.bias
features.denseblock3.denselayer20.norm2.running_mean
features.denseblock3.denselayer20.norm2.running_var
features.denseblock3.denselayer20.norm2.num_batches_tracked
features.denseblock3.denselayer20.conv2.weight
features.denseblock3.denselayer21.norm1.weight
features.denseblock3.denselayer21.norm1.bias
features.denseblock3.denselayer21.norm1.running_mean
features.denseblock3.denselayer21.norm1.running_var
features.denseblock3.denselayer21.norm1.num_batches_tracked
features.denseblock3.denselayer21.conv1.weight
features.denseblock3.denselayer21.norm2.weight
features.denseblock3.denselayer21.norm2.bias
features.denseblock3.denselayer21.norm2.running_mean
features.denseblock3.denselayer21.norm2.running_var
features.denseblock3.denselayer21.norm2.num_batches_tracked
features.denseblock3.denselayer21.conv2.weight
features.denseblock3.denselayer22.norm1.weight
features.denseblock3.denselayer22.norm1.bias
features.denseblock3.denselayer22.norm1.running_mean
features.denseblock3.denselayer22.norm1.running_var
features.denseblock3.denselayer22.norm1.num_batches_tracked
features.denseblock3.denselayer22.conv1.weight
features.denseblock3.denselayer22.norm2.weight
features.denseblock3.denselayer22.norm2.bias
features.denseblock3.denselayer22.norm2.running_mean
features.denseblock3.denselayer22.norm2.running_var
features.denseblock3.denselayer22.norm2.num_batches_tracked
features.denseblock3.denselayer22.conv2.weight
features.denseblock3.denselayer23.norm1.weight
features.denseblock3.denselayer23.norm1.bias
features.denseblock3.denselayer23.norm1.running_mean
features.denseblock3.denselayer23.norm1.running_var
features.denseblock3.denselayer23.norm1.num_batches_tracked
features.denseblock3.denselayer23.conv1.weight
features.denseblock3.denselayer23.norm2.weight
features.denseblock3.denselayer23.norm2.bias
features.denseblock3.denselayer23.norm2.running_mean
features.denseblock3.denselayer23.norm2.running_var
features.denseblock3.denselayer23.norm2.num_batches_tracked
features.denseblock3.denselayer23.conv2.weight
features.denseblock3.denselayer24.norm1.weight
features.denseblock3.denselayer24.norm1.bias
features.denseblock3.denselayer24.norm1.running_mean
features.denseblock3.denselayer24.norm1.running_var
features.denseblock3.denselayer24.norm1.num_batches_tracked
features.denseblock3.denselayer24.conv1.weight
features.denseblock3.denselayer24.norm2.weight
features.denseblock3.denselayer24.norm2.bias
features.denseblock3.denselayer24.norm2.running_mean
features.denseblock3.denselayer24.norm2.running_var
features.denseblock3.denselayer24.norm2.num_batches_tracked
features.denseblock3.denselayer24.conv2.weight
features.transition3.norm.weight
features.transition3.norm.bias
features.transition3.norm.running_mean
features.transition3.norm.running_var
features.transition3.norm.num_batches_tracked
features.transition3.conv.weight
features.denseblock4.denselayer1.norm1.weight
features.denseblock4.denselayer1.norm1.bias
features.denseblock4.denselayer1.norm1.running_mean
features.denseblock4.denselayer1.norm1.running_var
features.denseblock4.denselayer1.norm1.num_batches_tracked
features.denseblock4.denselayer1.conv1.weight
features.denseblock4.denselayer1.norm2.weight
features.denseblock4.denselayer1.norm2.bias
features.denseblock4.denselayer1.norm2.running_mean
features.denseblock4.denselayer1.norm2.running_var
features.denseblock4.denselayer1.norm2.num_batches_tracked
features.denseblock4.denselayer1.conv2.weight
features.denseblock4.denselayer2.norm1.weight
features.denseblock4.denselayer2.norm1.bias
features.denseblock4.denselayer2.norm1.running_mean
features.denseblock4.denselayer2.norm1.running_var
features.denseblock4.denselayer2.norm1.num_batches_tracked
features.denseblock4.denselayer2.conv1.weight
features.denseblock4.denselayer2.norm2.weight
features.denseblock4.denselayer2.norm2.bias
features.denseblock4.denselayer2.norm2.running_mean
features.denseblock4.denselayer2.norm2.running_var
features.denseblock4.denselayer2.norm2.num_batches_tracked
features.denseblock4.denselayer2.conv2.weight
features.denseblock4.denselayer3.norm1.weight
features.denseblock4.denselayer3.norm1.bias
features.denseblock4.denselayer3.norm1.running_mean
features.denseblock4.denselayer3.norm1.running_var
features.denseblock4.denselayer3.norm1.num_batches_tracked
features.denseblock4.denselayer3.conv1.weight
features.denseblock4.denselayer3.norm2.weight
features.denseblock4.denselayer3.norm2.bias
features.denseblock4.denselayer3.norm2.running_mean
features.denseblock4.denselayer3.norm2.running_var
features.denseblock4.denselayer3.norm2.num_batches_tracked
features.denseblock4.denselayer3.conv2.weight
features.denseblock4.denselayer4.norm1.weight
features.denseblock4.denselayer4.norm1.bias
features.denseblock4.denselayer4.norm1.running_mean
features.denseblock4.denselayer4.norm1.running_var
features.denseblock4.denselayer4.norm1.num_batches_tracked
features.denseblock4.denselayer4.conv1.weight
features.denseblock4.denselayer4.norm2.weight
features.denseblock4.denselayer4.norm2.bias
features.denseblock4.denselayer4.norm2.running_mean
features.denseblock4.denselayer4.norm2.running_var
features.denseblock4.denselayer4.norm2.num_batches_tracked
features.denseblock4.denselayer4.conv2.weight
features.denseblock4.denselayer5.norm1.weight
features.denseblock4.denselayer5.norm1.bias
features.denseblock4.denselayer5.norm1.running_mean
features.denseblock4.denselayer5.norm1.running_var
features.denseblock4.denselayer5.norm1.num_batches_tracked
features.denseblock4.denselayer5.conv1.weight
features.denseblock4.denselayer5.norm2.weight
features.denseblock4.denselayer5.norm2.bias
features.denseblock4.denselayer5.norm2.running_mean
features.denseblock4.denselayer5.norm2.running_var
features.denseblock4.denselayer5.norm2.num_batches_tracked
features.denseblock4.denselayer5.conv2.weight
features.denseblock4.denselayer6.norm1.weight
features.denseblock4.denselayer6.norm1.bias
features.denseblock4.denselayer6.norm1.running_mean
features.denseblock4.denselayer6.norm1.running_var
features.denseblock4.denselayer6.norm1.num_batches_tracked
features.denseblock4.denselayer6.conv1.weight
features.denseblock4.denselayer6.norm2.weight
features.denseblock4.denselayer6.norm2.bias
features.denseblock4.denselayer6.norm2.running_mean
features.denseblock4.denselayer6.norm2.running_var
features.denseblock4.denselayer6.norm2.num_batches_tracked
features.denseblock4.denselayer6.conv2.weight
features.denseblock4.denselayer7.norm1.weight
features.denseblock4.denselayer7.norm1.bias
features.denseblock4.denselayer7.norm1.running_mean
features.denseblock4.denselayer7.norm1.running_var
features.denseblock4.denselayer7.norm1.num_batches_tracked
features.denseblock4.denselayer7.conv1.weight
features.denseblock4.denselayer7.norm2.weight
features.denseblock4.denselayer7.norm2.bias
features.denseblock4.denselayer7.norm2.running_mean
features.denseblock4.denselayer7.norm2.running_var
features.denseblock4.denselayer7.norm2.num_batches_tracked
features.denseblock4.denselayer7.conv2.weight
features.denseblock4.denselayer8.norm1.weight
features.denseblock4.denselayer8.norm1.bias
features.denseblock4.denselayer8.norm1.running_mean
features.denseblock4.denselayer8.norm1.running_var
features.denseblock4.denselayer8.norm1.num_batches_tracked
features.denseblock4.denselayer8.conv1.weight
features.denseblock4.denselayer8.norm2.weight
features.denseblock4.denselayer8.norm2.bias
features.denseblock4.denselayer8.norm2.running_mean
features.denseblock4.denselayer8.norm2.running_var
features.denseblock4.denselayer8.norm2.num_batches_tracked
features.denseblock4.denselayer8.conv2.weight
features.denseblock4.denselayer9.norm1.weight
features.denseblock4.denselayer9.norm1.bias
features.denseblock4.denselayer9.norm1.running_mean
features.denseblock4.denselayer9.norm1.running_var
features.denseblock4.denselayer9.norm1.num_batches_tracked
features.denseblock4.denselayer9.conv1.weight
features.denseblock4.denselayer9.norm2.weight
features.denseblock4.denselayer9.norm2.bias
features.denseblock4.denselayer9.norm2.running_mean
features.denseblock4.denselayer9.norm2.running_var
features.denseblock4.denselayer9.norm2.num_batches_tracked
features.denseblock4.denselayer9.conv2.weight
features.denseblock4.denselayer10.norm1.weight
features.denseblock4.denselayer10.norm1.bias
features.denseblock4.denselayer10.norm1.running_mean
features.denseblock4.denselayer10.norm1.running_var
features.denseblock4.denselayer10.norm1.num_batches_tracked
features.denseblock4.denselayer10.conv1.weight
features.denseblock4.denselayer10.norm2.weight
features.denseblock4.denselayer10.norm2.bias
features.denseblock4.denselayer10.norm2.running_mean
features.denseblock4.denselayer10.norm2.running_var
features.denseblock4.denselayer10.norm2.num_batches_tracked
features.denseblock4.denselayer10.conv2.weight
features.denseblock4.denselayer11.norm1.weight
features.denseblock4.denselayer11.norm1.bias
features.denseblock4.denselayer11.norm1.running_mean
features.denseblock4.denselayer11.norm1.running_var
features.denseblock4.denselayer11.norm1.num_batches_tracked
features.denseblock4.denselayer11.conv1.weight
features.denseblock4.denselayer11.norm2.weight
features.denseblock4.denselayer11.norm2.bias
features.denseblock4.denselayer11.norm2.running_mean
features.denseblock4.denselayer11.norm2.running_var
features.denseblock4.denselayer11.norm2.num_batches_tracked
features.denseblock4.denselayer11.conv2.weight
features.denseblock4.denselayer12.norm1.weight
features.denseblock4.denselayer12.norm1.bias
features.denseblock4.denselayer12.norm1.running_mean
features.denseblock4.denselayer12.norm1.running_var
features.denseblock4.denselayer12.norm1.num_batches_tracked
features.denseblock4.denselayer12.conv1.weight
features.denseblock4.denselayer12.norm2.weight
features.denseblock4.denselayer12.norm2.bias
features.denseblock4.denselayer12.norm2.running_mean
features.denseblock4.denselayer12.norm2.running_var
features.denseblock4.denselayer12.norm2.num_batches_tracked
features.denseblock4.denselayer12.conv2.weight
features.denseblock4.denselayer13.norm1.weight
features.denseblock4.denselayer13.norm1.bias
features.denseblock4.denselayer13.norm1.running_mean
features.denseblock4.denselayer13.norm1.running_var
features.denseblock4.denselayer13.norm1.num_batches_tracked
features.denseblock4.denselayer13.conv1.weight
features.denseblock4.denselayer13.norm2.weight
features.denseblock4.denselayer13.norm2.bias
features.denseblock4.denselayer13.norm2.running_mean
features.denseblock4.denselayer13.norm2.running_var
features.denseblock4.denselayer13.norm2.num_batches_tracked
features.denseblock4.denselayer13.conv2.weight
features.denseblock4.denselayer14.norm1.weight
features.denseblock4.denselayer14.norm1.bias
features.denseblock4.denselayer14.norm1.running_mean
features.denseblock4.denselayer14.norm1.running_var
features.denseblock4.denselayer14.norm1.num_batches_tracked
features.denseblock4.denselayer14.conv1.weight
features.denseblock4.denselayer14.norm2.weight
features.denseblock4.denselayer14.norm2.bias
features.denseblock4.denselayer14.norm2.running_mean
features.denseblock4.denselayer14.norm2.running_var
features.denseblock4.denselayer14.norm2.num_batches_tracked
features.denseblock4.denselayer14.conv2.weight
features.denseblock4.denselayer15.norm1.weight
features.denseblock4.denselayer15.norm1.bias
features.denseblock4.denselayer15.norm1.running_mean
features.denseblock4.denselayer15.norm1.running_var
features.denseblock4.denselayer15.norm1.num_batches_tracked
features.denseblock4.denselayer15.conv1.weight
features.denseblock4.denselayer15.norm2.weight
features.denseblock4.denselayer15.norm2.bias
features.denseblock4.denselayer15.norm2.running_mean
features.denseblock4.denselayer15.norm2.running_var
features.denseblock4.denselayer15.norm2.num_batches_tracked
features.denseblock4.denselayer15.conv2.weight
features.denseblock4.denselayer16.norm1.weight
features.denseblock4.denselayer16.norm1.bias
features.denseblock4.denselayer16.norm1.running_mean
features.denseblock4.denselayer16.norm1.running_var
features.denseblock4.denselayer16.norm1.num_batches_tracked
features.denseblock4.denselayer16.conv1.weight
features.denseblock4.denselayer16.norm2.weight
features.denseblock4.denselayer16.norm2.bias
features.denseblock4.denselayer16.norm2.running_mean
features.denseblock4.denselayer16.norm2.running_var
features.denseblock4.denselayer16.norm2.num_batches_tracked
features.denseblock4.denselayer16.conv2.weight
features.norm5.weight
features.norm5.bias
features.norm5.running_mean
features.norm5.running_var
features.norm5.num_batches_tracked
classifier.weight
classifier.bias

Is there anyway that we can replace these names with their original names (indexes in Sequential I think)?
I think this would be easiest way. this way we can rename and save the model in python and then load it directly in C++. I'm not that familiar with the python interface so I need a little help here.

@ShahriarRezghi
Copy link
Contributor Author

Hi @fmassa can you help me with the above problem?

@ShahriarRezghi
Copy link
Contributor Author

Hi @fmassa
I fixed all the issues and I ran the python tests that I wrote but outputs of all of the models are too far apart from each other. I will try to test a very simple model but I think that the implementation of the models are not the problem here.

@fmassa
Copy link
Member

fmassa commented May 19, 2019

Can you put the models in evaluation mode? Many of the models have dropout / batch norm, and those layers have non-determinism during training mode.

@ShahriarRezghi
Copy link
Contributor Author

@fmassa putting models in eval mode fixed the issue but the test for googlenet still fails. I'll look into it.

@ShahriarRezghi
Copy link
Contributor Author

Hi @fmassa
I Fixed the error and the tests are passing now.

@ShahriarRezghi
Copy link
Contributor Author

Hi @fmassa what's next?

@fmassa
Copy link
Member

fmassa commented Jun 4, 2019

Hi @ShahriarSS ,

Sorry for the delay in replying, I was very busy with the 0.3 release.

Looks like there is a merge conflict, can you fix that?

Once you fix it and tests are passing this will be ready to merge, thanks!

@fmassa
Copy link
Member

fmassa commented Jun 6, 2019

@ShahriarSS tests are still failing, can you have a look?

@ShahriarRezghi
Copy link
Contributor Author

@fmassa Tests are passing now

setup.py Show resolved Hide resolved
Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the awesome work @ShahriarSS !

@fmassa fmassa merged commit b5db97b into pytorch:master Jun 11, 2019
@ShahriarRezghi
Copy link
Contributor Author

Great. I will update C++ models when python ones are updated. Also looking forward to implementing transforms.

@philipNoonan
Copy link
Contributor

Thanks for all of this @ShahriarSS its great stuff!

To get it to compile on visual studio, I had to change the 'or' to '||' in line 33 csrc/models/resnet.cpp. Should this be changed to keep those (at least 3) of us using windows happy?

@fmassa
Copy link
Member

fmassa commented Jun 17, 2019

@philipNoonan yes, can you send a PR fixing it?

philipNoonan added a commit to philipNoonan/vision that referenced this pull request Jun 18, 2019
Small fix to allow for the built library to be used in windows pytorch#728
fmassa pushed a commit that referenced this pull request Jun 19, 2019
* Enabling exporting symbols on windows

Small fix to allow for the built library to be used in windows #728

* added macro to allow for exported symbols on windows

* added macro to allow for exported symbols on windows

* removed cmake command

* added dllimport using torchvision_EXPORTS preprocessor
@ShahriarRezghi ShahriarRezghi deleted the cppmodels branch June 25, 2019 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants