From f29b94b09c55340d866fee572b0d77de4f1d0958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E7=BF=8A=E5=87=A1?= Date: Sun, 23 Aug 2026 17:39:40 +0800 Subject: [PATCH] Replace deprecated v2.ToTensor() with v2.ToImage() + v2.ToDtype(scale=True) v2.ToTensor() has emitted a UserWarning on construction since torchvision 0.15. Use the officially recommended replacement (output equivalent up to float precision). Co-Authored-By: Claude --- lightx2v/models/runners/wan/wan_matrix_game2_runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lightx2v/models/runners/wan/wan_matrix_game2_runner.py b/lightx2v/models/runners/wan/wan_matrix_game2_runner.py index f7dd15f42..d69506f73 100755 --- a/lightx2v/models/runners/wan/wan_matrix_game2_runner.py +++ b/lightx2v/models/runners/wan/wan_matrix_game2_runner.py @@ -157,7 +157,8 @@ def __init__(self, config): self.frame_process = v2.Compose( [ v2.Resize(size=(352, 640), antialias=True), - v2.ToTensor(), + v2.ToImage(), + v2.ToDtype(torch.float32, scale=True), v2.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5]), ] )