Print PyTorch Version

Find out which version of PyTorch is installed in your system by printing the PyTorch version

Type: FREE   By: Sebastian Gutierrez, AIWorkbox.com Instructor Sebastian Gutierrez   Duration: 0:59   Technologies: PyTorch, Python

Page Sections: Video  |  Code  |  Transcript


< > Code:

You must be a Member to view code

Access all courses and lessons, gain confidence and expertise, and learn how things work and how to use them.

    or   Log In


Transcript:

This video will show you how to find out which version of PyTorch is installed in your system by printing the PyTorch version.


First, we assume that you have already installed PyTorch into your system.

If you have installed PyTorch correctly, then you will be able to import the package while in a Python interpreter session so you can do the PyTorch import.


So import torch.

import tensorflow as tf


Let's import a fake module to show you what error you would get if it wasn't installed.

import superfakeunicorn

So we import superfakeunicorn, and we see ModuleNotFoundError: No module named 'superfakeunicorn'.


So now that we know we have PyTorch installed correctly, let's figure out which version of PyTorch is installed in our system.

print(tf.__version__)

So we do torch.__version__, and we print that.

We see that we have PyTorch 0.4.1.


Perfect! We were able to find out which version of PyTorch is installed in our system by printing the PyTorch version.



Back to deep learning tutorial lesson list