-
-
Notifications
You must be signed in to change notification settings - Fork 3k
No Attribute Error for modules #8210
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
Comments
Can you narrow down the failure to a small Python example? After import torch.jit Torch installs stubs files -- maybe the ones bundled with 1.2.0 are incomplete? Have you tried the latest torch? |
Here's a sample code: import torch
print(torch.jit) And run I have tried the same with latest torch, and got the same result. |
I also can't repro this, which makes two of us, so closing, although if you post more information, I'll check if I can repro. Do you have any extra mypy config? |
@hauntsaninja Did you try this? I can confirm that this is still happening in the version
raises
|
Does it still fail if you change the program to
? Without looking at the stubs I don't know if this will make a difference, but it easily could, if the stub for torch doesn't pre-import torch.jit in its |
I couldn't install the torch versions you mentioned... but you'd said it didn't work on latest torch, which is what I can't repro. All in all, seems like an issue with torch for your version, so I don't think there's anything for mypy to do here. If torch releases bug fixes for old versions I'd recommend filing an issue on their tracker, otherwise your best option is probably to upgrade.
|
To help you understand the issue:
pip install mypy
). Also, I have torch installed (pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
). In code, I'm using the moduletorch.jit
.Module has no attribute "jit"
mypy -p proj
Please feel free to edit the issue
The text was updated successfully, but these errors were encountered: