Install Pytorch on Blender 2.90 python on Windows

Basically, it's not much different from installing on Blender 2.8x. I thought that it would not be possible to install it in 2.90, but it was easier than I expected. I don't have much information, but I'll make a note of it.

Premise

Blender is assumed to be installed in C: \ Program Files \ Blender Foundation. It is assumed that the CUDA and GPU drivers are already installed.

procedure

  1. Open PowerShell ** with administrator privileges **.
  2. Upgrade pip.
  3. Install pytorch.

Only this.

.powershell


> cd C:\Program Files\Blender Foundation\Blender 2.90\2.90\python\bin

> ./python -m pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/cb/28/91f26bd088ce8e22169032100d4260614fc3da435025ff389ef1d396a433/pip-20.2.4-py2.py3-none-any.whl (1.5MB)
     |████████████████████████████████| 1.5MB 1.1MB/s
Installing collected packages: pip
  Found existing installation: pip 19.2.3
    Uninstalling pip-19.2.3:
      Successfully uninstalled pip-19.2.3
Successfully installed pip-20.2.4

> ./python -m pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.6.0+cu101
  Downloading https://download.pytorch.org/whl/cu101/torch-1.6.0%2Bcu101-cp37-cp37m-win_amd64.whl (1021.6 MB)
     |████████████████████████████████| 1021.6 MB 750 bytes/s
...
Successfully installed future-0.18.2 pillow-8.0.0 torch-1.6.0+cu101 torchvision-0.7.0+cu101
>

To install Pytorch, just copy and paste the CUDA version etc. from the official page as usual.

image.png

In addition, use pip to add necessary items such as matplotlib.

.powershell


> ./python -m pip install matplotlib            
Collecting matplotlib
  Downloading matplotlib-3.3.2-cp37-cp37m-win_amd64.whl (8.5 MB)
     |████████████████████████████████| 8.5 MB 1.3 MB/s
...
Successfully installed certifi-2020.6.20 cycler-0.10.0 kiwisolver-1.2.0 matplotlib-3.3.2 pyparsing-2.4.7 python-dateutil-2.8.1 six-1.15.0

Tested with Blender's python console

If it's installed successfully, you can run import torch in Blender's python console.

image.png

By the way, when I tried to run pytorch_example / mnist / main.py, I got an error saying that I don't have permission. For the time being, this can be avoided by running blender with administrator privileges. You can also work around this by installing blender in a folder that your users can access.

Recommended Posts

Install Pytorch on Blender 2.90 python on Windows
Install python on windows
Install watchdog on Windows + Python 3.3
[Python] [Chainer] [Windows] Install Chainer on Windows
Python on Windows
Install xgboost (python version) on Windows
Install Python on Windows + pip + virtualenv
Install Python development environment on Windows 10
[Kivy] How to install Kivy on Windows [Python]
Install Python on Pidora.
Install Scrapy on python3
Install Python on Mac
Install Python 3 on Mac
Install Python3.4 on CentOS 6.6
Install Anaconda on Windows 10
python basic on windows ②
Install pycuda on Windows10
Python PyTorch install tips
Install Python 2.7.3 on CentOS 5.4
Install pygraphviz on Windows 10
Install Python 3.3 on Ubuntu 12.04
Install Chainer 1.5.0 on Windows
Install Python 3.4 on Mac
Install Python 3.6 on Docker
Install Python (for Windows)
Install and run Python3.5 + NumPy + SciPy on Windows 10
Install Python3, numpy, pandas, matplotlib, etc. on Windows
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
[Python] How to install OpenCV on Anaconda [Windows]
Install ZIP version Python and pip on Windows 10
Install Numpy on virtualenv on Windows
Set-enable Python virtualenv on Windows
Run Openpose on Python (Windows)
How to install Python [Windows]
Install Win-Kex (kali-linux) on Windows 10.
Install pygame on python3.4 on mac
Windows10: Install python dlib library
Install cvxpy on windows, Anaconda
Python + Kivy development on Windows
Install Python 3.8 on CentOS 7 (SCL)
Sphinx-autobuild (0.5.2) on Windows7, Python 3.5.1, Sphinx 1.3.5
Fastest Python installation on Windows
Build Python environment on Windows
Install pandas 0.14 on python3.4 [on Mac]
Install OpenCV on Ubuntu + python
Install Chainer 1.6 (GPU) on Windows 7.
Build python environment on windows
Python --Install MySQLDB on EC2
Install Python 3.8 on CentOS 8 (AppStream)
I ran python on windows
Python install in 2 lines @Windows
Use Python on Windows (PyCharm)
Install dlib for Python (Windows)
[Windows] [Python3] Install python3 and Jupyter Notebook (formerly ipython notebook) on Windows
Install Bash on Ubuntu on Windows, Ruby, Python, Jupyter, etc.
For those who can't install Python on Windows XP
Install Python Pillow on Amazon Linux
Install pytorch
Install Python 3.8 on Ubuntu 18.04 (OS standard)
Python 3.6 on Windows ... and to Xamarin.
Installing Kivy on Windows10 64bit Python3.5