Review of Installing Pytoch-GPU Version

本文档详述了在Windows环境下安装Pytorch GPU版及Norse库的步骤,包括下载Anaconda、CUDA 11.3、CuDNN,以及如何配置CuDNN到CUDA,并在Anaconda虚拟环境中安装Pytorch和Norse。最后提供了验证安装成功的代码示例。
摘要由CSDN通过智能技术生成

Introduction

In my final year project of the undergraduate study, I’m asked to use SNN for classification of event-camera data. After discussion with my leader and team members, we decided to use Norse as the python library for developing the SNN module. In this article, I will give a relatively detailed review of the installation of Pytorch and Norse.

1 Install Anaconda

1.1 Install from Origin Source

Anaconda can be downloaded from this website Anaconda Download. It is worth to notice that please change the location of the installation to other disks rather than in C.

1.2 Install by using the provided Link to BaiduNetworkDisk

You can also download all resources by using the BaiduNetworkDisk sharing as below: Link to BaiduNetworkDisk
password: kdlh
Unzip the .rar file and you will get three executable files and the one named after Anaconda is what you need here.

2 Download and Install Cuda 11.3 and Cudnn

2.1 Download from Origin Source

Download from the origin source: you can click here, choose the version of interest (we are using 11.3.1 here). After the downloading is finished, double click on the .exe file and install under the instruction.

2.2 Download from BaiduNetworkDisk

The Cuda 11.3 toolkits is in the same folder as you have installed in step 1.2, and is named by Cuda 11.3.1, double click on the file and just install the Cuda under the instructions.

3 Download the Cudnn

3.1 Download from Origin Source

You can visit the Official Website of Cudnn by this, don’t forget to choose the version for Cuda 11.x.

3.2 Download from BaiduNetworkDisk

Also in the same folder as before, which is a .zip file named by Cudnn 8.5.0.

3.3 Configure the Cudnn into Cuda

Switch to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3, the content in that folder is supposed to be as shown below.
Figure 1
Open the Downloaded Cudnn file and directly copy the three folders as shown below and paste that to the folder you opened before.
在这里插入图片描述
So far, you have finished the preparation of downloading Pytorch and Norse.

4 Download Pytorch-gpu to a virtual environment in Anaconda

First, search Anaconda Prompt in start menu.
Then, in order to create a new environment in other Disks rather than C: disk, type the following codes into the Anaconda Prompt.

	E:        # change to other disks 
	
	cd E:/Anaconda_Virtual_Environment # switch to the destination folder  
	
	conda create -n NameOfVirtualEnvironment
	
	conda activate NameOfVirtualEnvironment

	pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 -i https://pypi.tuna.tsinghua.edu.cn/simple some-package     # this three lines should be typed in one line

If this is done without any problem, Congratulations! You have sucessfully installed Pytorch with gpu acceleration! You can try the following codes out to verify if the installation is sucessful.

	python

	import pytorch
	print(torch.__version__)	# print the version of your pytorch
	print(torch.cuda.is_available())

在这里插入图片描述
If your result is the same as mine, congratulations!

5 Install Norse and Verify

5.1 Install Norse

Use the following commands to install.

	pip install norse

After that, open anaconda navigator and switch to the new virtual environment you have created as shown below,
在这里插入图片描述

and download the JupyterNotebook and Spyder. Then, open one of the two IDEs and verify if you have successfully installed Norse as below:

import torch
import norse.torch as norse

cell = norse.LIFCell()
data = torch.ones(1)
spikes, state = cell(data)        # First run is done without any state
# ...
spikes, state = cell(data, state) # Now we pass in the previous state

And if no warning occurs, then the norse is installed successfully! Cheers!
Please hesitate to contact me by the email: sh201@hw.ac.uk if any problem occurred!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

infinity250

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值