Training RF-DETR on SeaShips: GitLab Token Cloning, VOC-to-YOLO Conversion, and Checkpoint Resumption
2026-07-30 Training Log — SeaShips + RF-DETR
Note: Personal study record, no valuable opinions have been output yet.
But I believe: Little strokes fell great oaks.
1. Q: Cloning a dataset from GitLab to the server
Two IPs are in the same <gitlab-host>.0/24 subnet, network is reachable.
GitLab disables password login and only allows Personal Access Tokens. Go to <gitlab-host>/-/profile/personal_access_tokens to create a token, check read_repository.
# Embed the token directly in the URL to bypass VS Code credential helper socket issues
git -c credential.helper= clone 'http://username:token@<gitlab-host>/datasets/seaships_7000.git'
Security cleanup:
# 1. Clear shell history
history | grep 'token'
history -d <line_number>
# 2. Change git remote (remove token from URL)
cd seaships_7000 && git remote -v
git remote set-url origin http://<gitlab-host>/datasets/seaships_7000.git
2. Dataset format conversion — VOC → YOLO
SeaShips(7000) is in Pascal VOC format, RF-DETR requires YOLO format.
Conversion formula (VOC → YOLO):
x_center = (xmin + xmax) / 2 / image_width
y_center = (ymin + ymax) / 2 / image_height
width = (xmax - xmin) / image_width
height = (ymax - ymin) / image_height
YOLO txt per line: class_id x_center y_center width height (normalized to 0-1)
Directory structure:
seaships_yolo/
├── data.yaml
├── train/images/ + labels/
├── valid/images/ + labels/ ← Note: RF-DETR requires "valid" not "val"
└── test/images/ + labels/
Verification: Spot-check one xml and its corresponding txt, manually recalculate to verify.
3. Training
from rfdetr import RFDETRMedium
model = RFDETRMedium() # Weights auto-download to ~/.roboflow/models/
model.train(
dataset_dir="/opt/datasets/seaships_yolo",
epochs=100,
batch_size=4,
)
model.save("/opt/datasets/seaships_rfdetr_medium.pt")
Monitoring:
nvidia-smi | grep python # Check if the process is alive
tail -3 /opt/rf-detr/output/metrics.csv # Check mAP
Reason for slow training: DETR is 3-5x slower than YOLO (Transformer + Hungarian matching), plus vLLM/Ollama occupies VRAM.
4. Resuming training
A checkpoint is automatically saved to output/checkpoint_N.ckpt every epoch.
model.train(
dataset_dir="/opt/datasets/seaships_yolo",
epochs=100,
batch_size=4,
resume="/opt/rf-detr/output/checkpoint_19.ckpt", # Change to the latest number
)
The parameter name is resume, not ckpt_path.
5. AI-assisted experience
Basically just asking AI what to do next and then following along... The experience is: 1. Ask if there are dangers and how to solve them (token, history); 2. Manually check key points yourself (compare txt, xml); 3. Ask about the overall workflow before training instead of blindly following the next step.
Top 5 from juejin.cn, machine-translated. The original thread is authoritative.
Using Juejin for: 1 study notes; 2 industry problems and reflections. Of course, for now, before graduation, I treat it all as 1, since I haven't entered the industry yet... I hope later I can write articles with real value! I like rambling whenever I feel like it... feels like it suits me quite well! Comments before reaching 2 are just me talking to myself hahaha. Reasons for choosing Juejin: 1 learn in public, more motivating than writing in my own Obsidian, with a vague expectation of 'being seen'; 2 cleaner and simpler than CSDN, lower barrier than GitHub, and I can directly import md (AI helps me).
Pay attention to privacy and data masking... replace the IP with a placeholder like <gitlab-host>, the project name with your-project, and the path with /opt/datasets/ or similar generic names.
Random thoughts/sudden reflections on AI: Only when the tide goes out do you discover who's been swimming naked.
Today I also had DSv4 Pro try to export WeChat stickers for use as Mattermost statuses; the AI said it's still an industry-wide challenge. Hmm, I'll try Kimi K3 tomorrow. I remember a Japanese physicist used Claude/GPT to solve a long-unsolved physics problem. I still believe AI can solve currently unsolved problems, not just provide existing answers. Switch models! Or else just pay out of pocket for a foreign model subscription.
I'm 21 this year, one year left until graduation. The autumn recruitment season is upon me, but anxiety has left me unable to prepare. Yet I've finally written my first Juejin article. The summer was a huge blow; I thought about changing careers, thought some dark thoughts. But yesterday a good friend said, 'I feel like life is just beginning,' which gave me a sliver of hope in an otherwise bleak future. Does failing to get into a mid-sized or large company in the autumn recruitment, or not having mastered development skills yet, mean my whole life is a failure? Seeing Beef Bro's Xiaohongshu post today, it coincidentally aligned with my own reflections: both saying 'not getting into a big company doesn't mean a failed life.' I remember why I chose computer science for the college entrance exam: a person like me can do anything and get by; but since one has to work their whole life, spending it facing code is more fun than other things. And I want to make games. I remember why I transferred majors to study computer science. Eating in the Yujiatou cafeteria, I saw a roughly 10-second cyber-city video generated by Sora for the first time. I thought then: am I going to spend my life disconnected from the cutting edge of this era? I want to be closer to the times. So there wasn't much difficulty; I wanted to transfer, and I succeeded. The two wasted years that followed, just getting by in school and slowly getting by with myself, not developing interests, diving deep into tech, or planning a career, led to today's situation. I won't dwell on it; regret is useless. Do you like being a programmer? I want to say, even after experiencing over a dozen failed interviews this summer, I still like it. One has to work their whole life; spending it facing code is more interesting than doing other things. What a rare thing that is! I used to hate AI a bit, for making job hunting so annoying this year and making me have to learn so much. But thinking about my 'original intention,' I'm still hopeful. Maybe one day I really can make indie games and do more fun things; I can self-study and learn so much. Psychology, finance, simulating a cat's life. Through AI and technology, I can do many, many things that break down barriers of time cost and technical cost. Aren't you already very close to the tide of the times? You sought benevolence and received it—what is there to complain about?