Open 0x4E69676874466F78 opened 1 year ago
It looks like TensorRT writes to the log in UTF-16 (so there are extra "spaces").
[2022-09-15 19:45:35.068] [info] Backend: [27828] [INFO] Reading state dict from path: A:\Downloads\browser\003_realSR_BSRGAN_DFO_s64w8_SwinIR-M_x4_GAN.pth
[2022-09-15 19:45:35.225] [info] Backend: [27828] [INFO] Loading state dict into pytorch model arch
[2022-09-15 19:45:35.227] [error] Backend: C:\Users\fox\AppData\Roaming\chaiNNer\python\python\lib\site-packages\torch\functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:2157.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
it's possible that TensorRT just can't support SwinIR models with pixelshuffle. the error (which is amazingly difficult to read lol) is this:
E r r o r C o d e 4 : I n t e r n a l E r r o r ( R e s h a p e _ 4 2 : I S h u f f l e L a y e r a p p l i e d t o s h a p e t e n s o r m u s t h a v e 0 o r 1 r e s h a p e d i m e n s i o n s : d i m e n s i o n s w e r e [ - 1 , 2 ] )
@joeyballentine unpleasant yes, you need to force it to output in UTF-8.
Does the official RealESRGANx2 model work with tensorrt? if it doesn't, then the problem is definitely pixelunshuffle
though now that I think about it, I think swinir uses pixelshuffle without pixelunshuffle, so it would have to be pixelshuffle itself that's broken. let me check
@joeyballentine RealESRGAN_x2plus.pth?
An error occurred in a PyTorch Upscale Image node:
pixel_unshuffle expects height to be divisible by downscale_factor, but input.size(-2)=337 is not divisible by 2
Input values (partial):
• Image: RGB image 543x337
• Number of Tiles: Auto
(It doesn't even work with pytorch)
Seems like the solution is running this tensorrt tool on the engine file (which idk if you can do yourself at the moment without it caching the .engine file)
I try load 003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_GAN Simplified.onnx from https://github.com/joeyballentine/chaiNNer/issues/960#issuecomment-1248279853 chaiNNer silently loads model for a long time, but judging by the log, it ran into problems:
I've been waiting for over 20 minutes. Python consumes 8% CPU.