debug: 将归一化放在GPU上
This commit is contained in:
@@ -86,9 +86,8 @@ class SimpleRobotDataset(Dataset):
|
||||
h5_path = f'observations/images/{cam_name}'
|
||||
if h5_path in f:
|
||||
img = f[h5_path][meta["frame_idx"]]
|
||||
img = torch.from_numpy(img).float()
|
||||
# 归一化到 [0, 1] 范围(与推理时保持一致)
|
||||
img = img / 255.0
|
||||
img = torch.from_numpy(img)
|
||||
# 保持 uint8 格式以节省传输带宽,归一化移至 GPU (在 train_vla.py 中处理)
|
||||
frame[f"observation.{cam_name}"] = img.permute(2, 0, 1) # HWC -> CHW
|
||||
|
||||
return frame
|
||||
|
||||
Reference in New Issue
Block a user