Cannot import modules from torch
I have installed torch 1.4.0. It has worked with all modules for 4 months well. But yesterday I ran into a problem in Jupyter Notebook such as:
import torch
import torch.nn as nn
import torch.optim as optim

And it throws &quot;cannot find module torch.optim&quot;. But it could import torch and torch.nn! I can't understand why. I didn't change venv or install other packages. Same problem with torch.nn.Functional and torch.onnx. Does anybody know how to solve this problem?

So the problem solved with installing torch 1.6.0. I have no idea why this happened with torch 1.4.0. Anyway now it works.
