2025-08-14
Linux运维
00
  1. GPG 密钥过期
    bash
    展开代码
    The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654
    ROS 软件源的签名密钥已过期,导致系统拒绝信任该软件源。

解决方法

1. 更新 ROS 软件源密钥

运行以下命令修复 GPG 密钥:

bash
展开代码
sudo apt-key del F42ED6FBAB17C654 # 删除旧密钥 sudo apt update # 此时会提示缺少密钥 sudo apt install curl -y # 确保 curl 已安装 curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

2. 强制更新软件源

bash
展开代码
sudo apt update --fix-missing sudo apt clean # 清理损坏的缓存 sudo apt update
2025-08-13
深度学习
00

https://huggingface.co/docs/tokenizers/api/added-tokens

python
展开代码
from rich import print from transformers import AutoTokenizer def add_new_tokens(load_path: str, save_path: str, new_tokens: list[str]): tokenizer = AutoTokenizer.from_pretrained(load_path) tokenizer.add_tokens(new_tokens) tokenizer.save_pretrained(save_path) def update_tokenizer(model_path: str): add_new_tokens( model_path, model_path, ["<|call_start|>", "<|call_end|>", "<|toolcall_start|>", "<|toolcall_end|>"] ) def test_tokenizer(model_path: str): tokenizer = AutoTokenizer.from_pretrained(model_path) text = "hello <|call_start|> world <|call_end|>" print(text, tokenizer.tokenize(text), tokenizer.encode(text)) text = "hello <|toolcall_start|> world <|toolcall_end|>" print(text, tokenizer.tokenize(text), tokenizer.encode(text)) if __name__ == "__main__": update_tokenizer("/mnt/jfs6/model_ok/qwen2vl-0811-1/checkpoint-6400") test_tokenizer("/mnt/jfs6/model_ok/qwen2vl-0811-1/checkpoint-6400")
2025-08-13
Python
00

使用 /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc

bash
展开代码
def draw_bbox_on_pil_image(pil_image, bbox, text, color, thickness=2, font_size=12): """在PIL图片上绘制bbox和文本""" draw = ImageDraw.Draw(pil_image) # 获取图片尺寸 img_width, img_height = pil_image.size # 转换bbox格式 [x_br, y_br, x_tl, y_tl] -> [x1, y1, x2, y2] x_br, y_br, x_tl, y_tl = bbox # 将0-1000的归一化坐标转换为实际图片坐标 x_br = int(x_br * img_width / 1000) y_br = int(y_br * img_height / 1000) x_tl = int(x_tl * img_width / 1000) y_tl = int(y_tl * img_height / 1000) # 确保坐标顺序正确 x1 = min(x_tl, x_br) y1 = min(y_tl, y_br) x2 = max(x_tl, x_br) y2 = max(y_tl, y_br) # 绘制矩形框 draw.rectangle([x1, y1, x2, y2], outline=color, width=thickness) # 绘制文本 try: font = ImageFont.truetype("/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc", font_size) except: font = ImageFont.load_default() # 获取文本尺寸 bbox_text = draw.textbbox((0, 0), text, font=font) text_width = bbox_text[2] - bbox_text[0] text_height = bbox_text[3] - bbox_text[1] # 绘制文本背景 draw.rectangle([x1, y1 - text_height - 5, x1 + text_width + 10, y1], fill=(255, 255, 255), outline=(0, 0, 0)) # 绘制文本 draw.text((x1 + 5, y1 - text_height - 2), text, fill=(0, 0, 0), font=font) return pil_image
2025-08-12
ROS
00
2025-08-11
ROS
00

Cursor使用这样链接到容器里:

bash
展开代码
root@101.126.150.28 -p 8031
2025-08-10
ROS
00

在wang电脑操作。

之前操作的容器commit为镜像:

bash
展开代码
docker commit 954fb79c1f14 kevinchina/deeplearning:ros-noetic-cuda11.4.2
2025-08-08
深度学习ban
00

该文章已加密,点击 阅读全文 并输入密码后方可查看。

2025-08-08
深度学习ban
00

该文章已加密,点击 阅读全文 并输入密码后方可查看。

2025-08-07
ROS
00

测试

bash
展开代码
docker pull mzahana/ros-noetic-cuda11.4.2
2025-08-07
ROS
00