一个初始化的服务器,需要配置的相关软件以及环境(cuda、torch、conda)

文章目录

一个刚初始化的服务器需要下载的应用

google chrome

下载google浏览器

python 复制代码
https://www.google.cn/intl/zh-CN/chrome/

ghelp

python 复制代码
https://ghelper.net/

解压安装包

.tar.gz文件

python 复制代码
tar xzvf pycharm-community-2024.1.4.tar.gz
#x:解压。
#z:使用 gzip 解压。
#v:显示解压过程中的文件。
#f:指定文件名。

.deb文件

python 复制代码
sudo dpkg -i google-chrome-stable_current_amd64.deb

解压大型zip文件

直接终端输入jar,找到中间版本的jar进行安装

python 复制代码
#sudo apt install 
jar -xvf filename.zip

更新nvidia的驱动

出现nvidia-smi 指令显示不了的情况

pycharm设置

参考:pycharm设置

linux设置pycharm桌面图标

方法①

  • 终端输入
python 复制代码
sudo gedit /usr/share/applications/Pycharm.desktop
  • 然后修改打开文件的内容,将其中icon路径和exec路劲修改为你自己的路径
python 复制代码
[Desktop Entry]
Type=Application
Name=Pycharm
GenericName=Pycharm3
Comment=Pycharm3:The Python IDE
Exec=sh /home/dell/Downloads/pycharm-community-2024.1.4/bin/pycharm.sh
Icon=/home/dell/Downloads/pycharm-community-2024.1.4/bin/pycharm.png
Terminal=pycharm
Categories=Pycharm;

然后就加入成功了

方法②

直接用命令打开pycharm后,在菜单栏的tools里面选择创建desk top entry

conda相关

下载conda

参考资料: Conda超详细的linux-conda环境安装教程

下载conda的链接

python 复制代码
https://www.anaconda.com/download/success

选择这个进行下载

然后终端输入bash命令安装

python 复制代码
bash Anaconda3-2024.06-1-Linux-x86_64.sh

conda换源

参考 conda换源

python 复制代码
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
python 复制代码
conda config --set show_channel_urls yes

测试看一下加的源加成功了没有

python 复制代码
conda config --show channels

通过"conda config --show-sources" 查看配置文件的路径。配置文件为用户目录下的.condarc文件

python 复制代码
conda config --show-sources

打开这个文件对里面的默认包进行修改

.condarc文件里面

python 复制代码
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - defaults

如果出现大量debug报错

降低conda-build的版本

python 复制代码
conda install "conda-build!=3.26.0"

torch相关

安装torch包,浏览器下载包

这个网址找到对应的包进行下载

python 复制代码
https://download.pytorch.org/whl/cu118

torch、torchvision、torchaudio

然后pip名

python 复制代码
pip install    -i https://pypi.tuna.tsinghua.edu.cn/simple

安装pytorch

一般是安装11.8 pytorch 为2.0.1

python 复制代码
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia

常用包安装

python 复制代码
#PIL包
pip install Pillow -i https://pypi.tuna.tsinghua.edu.cn/simple

导包的方法

python 复制代码
import supervision as sv  (import 的路径不能带点)
from .datasets import transforms as T   (.导入当前目录或者包中的模块)
from ..datasets import transforms as T (..导入上一级目录中的模块)
相关推荐
likfishdn8 分钟前
Linux的文件与目录管理
linux·运维·服务器
渲染101专业云渲染10 分钟前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
游王子23 分钟前
OpenCV(11):人脸检测、物体识别
人工智能·opencv·计算机视觉
chian-ocean28 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=29 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
春末的南方城市34 分钟前
VidSketch:具有扩散控制的手绘草图驱动视频生成
人工智能·深度学习·计算机视觉·aigc
若云止水39 分钟前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_init_cycle 函数 - 详解(4)
数据库·nginx·ubuntu
橘子味的茶二39 分钟前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
紫雾凌寒39 分钟前
计算机视觉 |解锁视频理解三剑客——TimeSformer
python·深度学习·神经网络·计算机视觉·transformer·timesformer
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19