Skip to content

update torch2trt.py to make it work with windows and add logs to have…#11

Open
MaraScott wants to merge 1 commit intoGVCLab:mainfrom
MaraScott:feature-torch2trt4win
Open

update torch2trt.py to make it work with windows and add logs to have…#11
MaraScott wants to merge 1 commit intoGVCLab:mainfrom
MaraScott:feature-torch2trt4win

Conversation

@MaraScott
Copy link
Contributor

… a sense of progression

@pfn
Copy link

pfn commented Mar 8, 2026

I tried fetching this and running it, still encountering the same error:

personalive] $ python torch2trt_win.py
C:\Users\pfnguyen\Programs\miniconda3\envs\personalive\lib\site-packages\transformers\utils\generic.py:441: FutureWarning: `torch.utils._pytree._register_pytree_node` is deprecated. Please use `torch.utils._pytree.register_pytree_node` instead.
  _torch_pytree._register_pytree_node(
C:\Users\pfnguyen\Programs\miniconda3\envs\personalive\lib\site-packages\transformers\utils\generic.py:309: FutureWarning: `torch.utils._pytree._register_pytree_node` is deprecated. Please use `torch.utils._pytree.register_pytree_node` instead.
  _torch_pytree._register_pytree_node(
[DBG] Loading config: ./configs/prompts/personalive_online.yaml
[DBG] Loading PoseGuider...
[DBG] Loading MotionEncoder...
[DBG] Loading UNet3DConditionModel...
[DBG] Loading VAE...
[DBG] Creating scheduler...
[DBG] Building wrapped model...
[DBG] Exporting ONNX to: ./pretrained_weights/onnx/unet/unet.onnx
['pred_video', 'latents', 'pose_cond_fea_out', 'motion_hidden_states_out', 'motion_out', 'latent_first']
开始导出 ONNX 模型到: ./pretrained_weights/onnx/unet/unet.onnx ...
C:\Users\pfnguyen\Programs\miniconda3\envs\personalive\lib\site-packages\diffusers\models\embeddings.py:175: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
  if self.height != height or self.width != width:
... snip ...
RuntimeError: Expected tensor for argument #1 'input' to have the same type as tensor for argument #2 'weight'; but type torch.cuda.FloatTensor does not equal torch.cuda.HalfTensor (while checking arguments for cudnn_batch_norm)
personalive] $

this is in msys on windows, could be that the versions of packages are too new, e.g. pytorch 2.9.1+cu130 (to support blackwell)

yep, downgrading to pytorch 2.1.2 makes the error go away (however, there's no blackwell optimization, so it sucks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants