szagoruyko / pytorchviz

A small package to create visualizations of PyTorch execution graphs
MIT License
3.18k stars 279 forks source link

torchviz module not found #72

Closed egmaminta closed 2 years ago

egmaminta commented 2 years ago

Good day! I just discovered this handy package. I followed the instructions (installed thru pip install torchviz, etc.) but when I run my code, it produces an error saying that torchviz module is not found. I was hoping you could enlighten me on this. Thank you!

albanD commented 2 years ago

Hi,

This usually happens because you installed with pip for a different version of python compared to the one where you try to run the code. You can avoid this by doing:

python -m pip install torchviz
python
>>> import torchviz # That one should work fine
egmaminta commented 2 years ago

I see. Thank you!