Skip to content

Conversation

fmassa
Copy link
Member

@fmassa fmassa commented Aug 1, 2019

This simplifies hacking with the code, as now everything lives in a single place.

I have modified the functionality of the model (at least not on purpose).
I believe previous versions had a slight issue with the number of conv_builder blocks for mc_18 (5 instead of 4), but the last one wasn't used so this didn't change anything wrt the model that was generated.

I still need to update the trained model weights, which will be done in a follow-up PR.

cc @bjuncek

# init weights
self._initialize_weights()

if zero_init_residual:
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to make this the default behavior, and remove the arg?

Do you know if this changes anything wrt the performance?

Copy link
Contributor

@bjuncek bjuncek Aug 1, 2019

Choose a reason for hiding this comment

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

Do we want to make this the default behavior, and remove the arg?

Yeah, I think that's reasonable.

and no, haven't tried without it

Copy link
Contributor

@bjuncek bjuncek left a comment

Choose a reason for hiding this comment

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

Looks good to me - could we just verify that the number of params is still constant?

pretrained, progress,
block=BasicBlock,
conv_makers=[Conv2Plus1D] * 4,
layers=[2, 2, 2, 2],
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably add a guide on default configs?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking that this is how we currently implement it for resnets, and it should be fine in most cases?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose that makes sense - this is easier to hack ;)

# init weights
self._initialize_weights()

if zero_init_residual:
Copy link
Contributor

@bjuncek bjuncek Aug 1, 2019

Choose a reason for hiding this comment

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

Do we want to make this the default behavior, and remove the arg?

Yeah, I think that's reasonable.

and no, haven't tried without it

@fmassa
Copy link
Member Author

fmassa commented Aug 1, 2019

I just verified and the number of parameters is the same before and after the change.

@bjuncek
Copy link
Contributor

bjuncek commented Aug 1, 2019

Sounds good then :)

@codecov-io
Copy link

codecov-io commented Aug 4, 2019

Codecov Report

Merging #1190 into master will increase coverage by 0.01%.
The diff coverage is 79.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1190      +/-   ##
==========================================
+ Coverage   65.64%   65.65%   +0.01%     
==========================================
  Files          79       74       -5     
  Lines        5827     5780      -47     
  Branches      889      883       -6     
==========================================
- Hits         3825     3795      -30     
+ Misses       1731     1722       -9     
+ Partials      271      263       -8
Impacted Files Coverage Δ
torchvision/models/video/__init__.py 100% <100%> (ø) ⬆️
torchvision/models/video/resnet.py 79.52% <79.52%> (ø)
torchvision/ops/boxes.py 94.73% <0%> (ø) ⬆️
torchvision/io/video.py 72% <0%> (ø) ⬆️
torchvision/transforms/transforms.py 81.53% <0%> (+0.58%) ⬆️
torchvision/transforms/functional.py 71.38% <0%> (+1.44%) ⬆️

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 9168476...7dbd47f. Read the comment docs.

@fmassa
Copy link
Member Author

fmassa commented Aug 4, 2019

Training those models yielded the following accuracies, for a clip length of 16 frames:

model clip @ 1
r3d_18 52.748
mc3_18 53.898
r2plus1d_18 57.498

Which are pretty close to the reported results.

@fmassa fmassa merged commit 6a834e9 into pytorch:master Aug 4, 2019
@fmassa fmassa deleted the r3d-refactor branch August 4, 2019 22:07
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.

3 participants