[TOC]
创建虚拟环境
1 | conda create -n ${environment_name} |
激活虚拟环境
1 | conda activate ${environment_name} |
选择python版本
1 | conda install python=${python_version} |
安装cuda
1 | conda install cudatoolkit==${cuda_version} -c nvidia |
安装PyTorch
This transaction has incompatible packages due to a shared path.
1 | conda clean --all |
安装torch-scatter
1 | conda install pytorch-scatter -c pyg |
查询cuda memory
1 | nvidia-smi --query-gpu=memory.total,memory.used --format=csv |
检查当前GPU内存占用情况
1 | nvidia-smi --query-compute-apps=pid,name,gpu_bus_id,used_memory --format=csv |
1 | $ nvidia-smi --help-query-compute-apps |
orin安装pytorch
error: ‘class torch::Library’ has no member named ‘set_python_module’ 22
1 | git clone https://github.com/pytorch/vision torchvision |
安装timm
1 | wget <package>.whl |
数据集
下载数据集
用 wget 下载 KITTI 上的数据
先开代理。
1 | wget -b <link>.zip |
查看进度
1 | tail -f wget-log |
解压
1 | unzip <name>.zip |
从drive google下载
测试
一文解决 RuntimeError: CUDA out of memory. 全网最全
1 | with torch.no_grad(): |
Linux的一些操作
读取当前路径下的文件总大小
1 | du -sh |