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

[jit] better message for bad type annotation #47464

Closed
wants to merge 1 commit into from

Conversation

ppwwyyxx
Copy link
Contributor

@ppwwyyxx ppwwyyxx commented Nov 5, 2020

Summary:

ValueError: Unknown type annotation: 'typing.Sequence[torch.Tensor]' at  File "xxx.py", line 223
        images = [x["image"].to(self.device) for x in batched_inputs]
        images = [(x - self.pixel_mean) / self.pixel_std for x in images]
        images = ImageList.from_tensors(images, self.backbone.size_divisibility)
                 ~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
        return images

Otherwise have no clue where the error is.

Test Plan: sandcastle

Differential Revision: D24764886

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D24764886

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Nov 5, 2020
@ppwwyyxx ppwwyyxx requested review from SplitInfinity and eellison and removed request for apaszke November 5, 2020 21:12
@ppwwyyxx
Copy link
Contributor Author

ppwwyyxx commented Nov 5, 2020

ah the PR still has unrelated contents from a different PR.. but the diff is clean

Copy link

@SplitInfinity SplitInfinity left a comment

Choose a reason for hiding this comment

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

It seems that this is stacked on top of #45645 - if you unstack I think we can land this separately.

torch/jit/annotations.py Outdated Show resolved Hide resolved
Summary:
Pull Request resolved: pytorch#47464

```
ValueError: Unknown type annotation: 'typing.Sequence[torch.Tensor]' at  File "xxx.py", line 223
        images = [x["image"].to(self.device) for x in batched_inputs]
        images = [(x - self.pixel_mean) / self.pixel_std for x in images]
        images = ImageList.from_tensors(images, self.backbone.size_divisibility)
                 ~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
        return images
```

Otherwise have no clue where the error is.

Test Plan: sandcastle

Differential Revision: D24764886

fbshipit-source-id: b28de389024c447b59eafd0b654d792fd3b15961
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D24764886

@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #47464 into master will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master   #47464   +/-   ##
=======================================
  Coverage   81.44%   81.45%           
=======================================
  Files        1798     1798           
  Lines      188223   188223           
=======================================
+ Hits       153306   153309    +3     
+ Misses      34917    34914    -3     

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 24b549b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed fb-exported Merged oncall: jit Add this issue/PR to JIT oncall triage queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants