连接云服务器

  1. 在AutoDL里租一台RTX 3090的服务器,选择基础环境:MiniConda Conda3 Python3.10 Ubuntu22.04 CUDA11.8
  2. 在VS Code里按Ctrl + Shift + P,输入Remote-SSH,选择Add…,添加远程主机。
  3. 在AutoDL里复制登录命令和密码,在VS Code里相应地输入

连接SSH

  1. 检查是否安装Git:git --version
  2. 生成密钥:ssh-keygen -t ed25519 -C "email@example.com"
  3. 复制密钥:cat ~/.ssh/id_ed25519.pub
  4. 在Github上的SSH里添加New SSH Key

配置环境

  1. 克隆:git clone git@github.com:graphdeco-inria/gaussian-splatting.git --recursive
  2. 检查是否安装CUDA:nvcc --version
  3. 切换目录:cd gaussian-splatting
  4. 换清华源:
1
2
3
4
5
6
7
8
9
10
11
# 1. 添加清华源的 channels (对应 defaults, conda-forge, pytorch)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
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/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

# 2. 设置显示源地址(方便调试)
conda config --set show_channel_urls yes

# 3. 清理旧缓存(非常重要,否则可能还在用旧的慢速索引)
conda clean -i
  1. 用mamba:
1
2
3
conda install -n base -c conda-forge mamba

mamba env create -f environment.yml

转换

  1. 安装COLMAP:sudo apt update && sudo apt install colmap
  2. 检测COLMAP:colmap -h
  3. 连接FileZilla:协议SFTP,主机即SSH命令,输入对应的密码
  4. 在gaussian_splatting下创建存放训练数据的文件夹,在文件夹里创建一个项目的文件夹,然后创建input文件夹。把拍的照片用FileZilla放到input里。
  5. 虚拟显示:sudo apt update && sudo apt install xvfb -y
  6. 转换:xvfb-run -a python convert.py -s ./data/truck/

训练

  1. 训练:python train.py -s ./data/train
  2. 在output文件夹里得到结果