import torch.fx ModuleNotFoundError: No module named 'torch.fx'

Viewed 5693

After enabling torch and Cuda for my system according to my system GPU compatibility, whenever I am trying to run any program which needs to be run on GPU to enable the system, this error is coming. I could not able to find any solution for this. though I read about this that create another environment and this error will be solved but did not work for me. Please find the details of my system. for reference, I am using Python 3.7.2.

image include torch and Cuda version and device name

Details of NVIDIA Cuda compiler driver

nvidia-smi output

Can anyone help to solve this problem? Thank you

2 Answers

torch.fx was added in PyTorch 1.8.0. Check release post. You're probably using an older version. Upgrade pytorch from website.

Instead of using

import torch.fx

You have to import from torch.fx as below:

from torch.fx import symbolic_trace

You can view more in the official documentations.

Related