Windows环境
下载Miniconda
从Conda官网下载合适的Miniconda环境,然后安装环境。
利用pycharm启动Miniconda环境
安装基本工具
pip install jupyter torch torchvision
Windows启动jupyter脚本
创建文本文件,将下述脚本复制进去,改为start_jupyter.bat文件,双击即可启动jupyter记事本
@echo off
:: 设置Miniconda路径
set conda_path=C:\Users\Administrator\miniconda3
:: 检查Miniconda是否已安装
if not exist "%conda_path%" (
echo Miniconda未找到,请先安装Miniconda并设置正确的路径。
pause
exit /b
)
:: 激活Miniconda环境
call "%conda_path%\Scripts\activate.bat"
:: 启动Jupyter
start "" "%conda_path%\Scripts\jupyter-notebook.exe"
:: 退出Miniconda环境
call conda deactivate
Linux环境
简介
我用的是Ubuntu环境,为方便配置Linux环境,我编写了一个shell脚本,脚本仓库为pytorch-environment
安装python3
apt install python3.10
安装Miniconda
从Conda官网获取网址
通过wget获取shell脚本,运行shell脚本
wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-Linux-x86_64.sh
安装基本工具
pip install jupyter torch torchvision
❤️ 转载文章请注明出处,谢谢!❤️