-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Remove deprecated APIs for 0.14 #6258
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
Remove deprecated APIs for 0.14 #6258
Conversation
…l keep them around?
|
||
|
||
def voc(): | ||
# TODO: Also test the "2007-test" key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm conveniently leaving this as a TODO, because we actually don't try to download voc()
anyway: further down in this file, the call to voc()
is commented out because their server is unstable.
torchvision/csrc/models/modelsimpl.h
Outdated
"The vision::models namespace is not actively maintained, use at " | ||
"your own discretion. We recommend using Torch Script instead: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we originally didn't intend to deprecate the C++ models: at least according to #4375 (review), the original intention was to stop maintaininng them but to still keep them around.
So I put back the original warning, instead of removing the files. I'll still wait for @datumbox 's input on this tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking @NicolasHug. The intention was to remove them. The majority of the new models can't be added on C++ because the layers are only available on Python. So I think we are good to drop them, which was the intention when we deprecated them.
… into remove_deprecated_0_14
@datumbox following up on #6258 (comment) about the C++ models: if that works for you, I'll remove them in another PR. The only reason is that I fear that removing them might break some stuff internally. I'd rather isolate that in a separate PR, to avoid having to potentially revert other unrelated changes (like the rest of the deprecations). |
@kazhang thanks for pointing out that |
Thanks @jdsgomes . I opened D38393214 to see what tests might break if we removed these files. |
@NicolasHug I don't have a super strong opinion about splitting the PRs if that simplifies your work. Curious why you think this can cause issues on FBcode though. As far as I see we don't even compile these sources on BUCK, so I don't see how people are using them. Have you saw anything different? If not, you can add the removal here; otherwise send a separate PR that removes the endpoints in question as you proposed. Happy to provide the necessary stamps once you confirm things work on FBcode + the tests pass. |
|
||
|
||
warnings.warn( | ||
"The 'torchvision.transforms._functional_video' module is deprecated since 0.12 and will be removed in 0.14. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented this on the internal diff that @YosuaMichael opened to check the deprecation but for visibility to the community here is my comment here:
we can not deprecate torchvision.transforms._transforms_video since we don't offer currently an alternative. I will be working on this next week. I recommend changing the deprecation message on OSS to notify that we would be removing this on a future version and then go from scratch through a deprecation process once we have a clear alternative to define.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@datumbox I add back this file and change the warnings message, could you double check if this message is good? We can change the message to give exact version when it will be removed once we have a clear alternative as you said.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if it's worth making this change on a separate PR on main because this one is quite massive. The message looks OK to me. There are a few more things we would need to revert such as the unit-tests for the specific module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we really need to delay the removal here: on top of being deprecated, these APIs are private. Users who are still relying on it have been ignoring strong signals. IMHO we should either:
- contact all downstream users who are still relying on this and tell them they have 10 days (or whatever) to update their code
- be nice to them and submit diffs so that they vendor
_functional_video.py
themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the unit-test, do you mean the test_transforms_video.py
? I also reverted it in this PR so it is not deleted.
For changing the message, I think it is a good idea to have separate PR just to make sure it has more visibility for the change in deprecation plan. I will revert back the message here and create another PR for that then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NicolasHug in my understanding, currently there is no alternatives for the _functional_video.py
. In this situation, it will be very difficult for the users to update their code by just changing API or import.
By they vendor _functional_video.py themselves
do you mean to copy and paste the _function_video.py on users code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NicolasHug Multiple internal users are still depending on this. Unless you want to dedicate your next 10 days porting their code away from these definitions and working with each individual team to ensure the results in production are identical, I don't think we can proceed with the removal.
If you check Yosua's Diff you will see multiple tests failing. In addition to the internal stuff, libraries such as PyTorch Video (cc @haooooooqi @lyttonhao) and ClassyVision (cc @jdsgomes @nairbv) are also affected.
IMO the issue with the specific deprecation is that it doesn't provide an actionable alternative that works out of the box for users and that lead to them not moving away from it. Though I agree there are concerns about respecting our own policies, we probably want to avoid breaking all downstream projects. I recommend reverting this removal to unblock the rest of the deprecations that are more straightforward and bring this topic up for discussion on the next weekly. There we can decide if we should move forwards with deprecating the specific part or not, without delaying the rest of the work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By they vendor _functional_video.py themselves do you mean to copy and paste the _function_video.py on users code?
Yes, I mean that each downstream library could simply copy this file in their code-base. _functional_video.py
is a small self-contained file that only has torch
as dependency, so this would be a very reasonable ask from us. (the same goes for _transforms_video.py
which just depends on torch/torchvision
)
I recommend reverting this removal to unblock the rest of the deprecations that are more straightforward and bring this topic up for discussion on the next weekly. There we can decide if we should move forwards with deprecating the specific part or not, without delaying the rest of the work
I'm not sure I understand what we mean by "move forwards with deprecating the specific part or not", but I agree we can discuss how to move forward with _functional_video.py
case separately (urgently, considering the approaching release).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@datumbox yes I confirm that _ClassyVision uses _transforms_video.py
. I also see (less) references for _functional_video.py
, so @NicolasHug do dpwnstream this file could be feasible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, we are agree to discuss how to handle _functional_video.py
(probably in weekly). And if we decide to remove it, I will create separate PR for that.
@NicolasHug @datumbox @jdsgomes Could you check if this PR is okay to merge?
I have checked and everything seems fine to me on this PR and I prefer if we can merge this PR faster and do fbsync in case anything we need to revert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GH doesn't let me approve as I'm the original author, but LGMT. Thanks @YosuaMichael
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YosuaMichael stamping to unblock. LGTM, with only 2 questions below.
GH doesn't let me approve as I'm the original author,
@NicolasHug do you prefer to do this on a new PR so that the attribution is right?
Just FYI, the changes in this PR come from my commits. But whether this PR gets merged or another makes no difference to me. |
The failed test seems to be not related to this PR, will merge |
Hey @YosuaMichael! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Summary: * Remove Kinetics400 class * Remove '2007-test' in VOC * Remove some MobileNet layer classes * Remove torchvision/models/segmentation/segmentation.py * Remove some MultiScaleRoIAlign methods * Remove torchvision/transforms/_functional_video.py * Remove torchvision/transforms/_transforms_video.py * Remove resample parameter in transforms * Remove 'range' parameter * Remove 'fill_value' parameter in transforms * Revert to original warning for C++ models - looks like we should still keep them around? * pre-commit * Fix docs * Remove test/test_transforms_video.py * Some fixes * Remove more tests * Revert changes to C++ models * Add back _transforms_video and change warning message * Change back the warning message, and will change the warning message on separate PR Reviewed By: YosuaMichael Differential Revision: D39886047 fbshipit-source-id: 52e3629ce0342817b6746351da6025cbc8a9589d Co-authored-by: YosuaMichael <yosuamichaelm@gmail.com> Co-authored-by: Yosua Michael Maranatha <yosuamichael@fb.com>
Summary: * Remove Kinetics400 class * Remove '2007-test' in VOC * Remove some MobileNet layer classes * Remove torchvision/models/segmentation/segmentation.py * Remove some MultiScaleRoIAlign methods * Remove torchvision/transforms/_functional_video.py * Remove torchvision/transforms/_transforms_video.py * Remove resample parameter in transforms * Remove 'range' parameter * Remove 'fill_value' parameter in transforms * Revert to original warning for C++ models - looks like we should still keep them around? * pre-commit * Fix docs * Remove test/test_transforms_video.py * Some fixes * Remove more tests * Revert changes to C++ models * Add back _transforms_video and change warning message * Change back the warning message, and will change the warning message on separate PR Reviewed By: datumbox Differential Revision: D40015852 fbshipit-source-id: 45e31f6ea00c25a4d4db719e8856784cb40ddfd8 Co-authored-by: YosuaMichael <yosuamichaelm@gmail.com> Co-authored-by: Yosua Michael Maranatha <yosuamichael@fb.com>
Closes #6257
git grep -n "0\.14" torchvision/
now gives zero output