-
Notifications
You must be signed in to change notification settings - Fork 630
Description
class SmilingEncode(nn.Module):
def __init__(self, model):
super().__init__()
self.model = model
def forward(self, xT, cond2):
img = self.model.render_speedster(xT, cond2)
return img
xT_model = SmilingXT(model).to(device).eval()
input_data = [((torch.randn(1, 3, 256, 256), torch.randn(1, 512)), torch.tensor([0])) for _ in range(100)]
xT_optimized_model = optimized_model = optimize_model(
xT_model, input_data=input_data, optimization_time="unconstrained", device=device)
save_model(xT_optimized_model, "speedster/xT_optimized_model")
2023-09-13 18:19:45 | INFO | Running Speedster on GPU:1
2023-09-13 18:23:05 | INFO | Benchmark performance of original model
2023-09-13 18:27:29 | INFO | Original model latency: 2.0304924035072327 sec/iter
============= Diagnostic Run torch.onnx.export version 2.0.1+cu117 =============
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================
2023-09-13 19:07:56 | INFO | [1/2] Running PyTorch Optimization Pipeline
2023-09-13 19:07:57 | INFO | Optimizing with TorchScriptCompiler and q_type: None.
2023-09-13 19:07:58 | WARNING | Unable to trace model with torch.fx
2023-09-13 19:07:59 | WARNING | Optimization failed with DeepLearningFramework.PYTORCH interface of ModelCompiler.TORCHSCRIPT. Got error LitModel is not attached to a Trainer.. If possible the compilation will be re-scheduled with another interface. Please consult the documentation for further info or open an issue on GitHub for receiving assistance.
2023-09-13 19:08:00 | INFO | Optimizing with TorchScriptCompiler and q_type: QuantizationType.HALF.
2023-09-13 19:08:00 | WARNING | Unable to trace model with torch.fx
2023-09-13 19:08:02 | WARNING | Optimization failed with DeepLearningFramework.PYTORCH interface of ModelCompiler.TORCHSCRIPT. Got error LitModel is not attached to a Trainer.. If possible the compilation will be re-scheduled with another interface. Please consult the documentation for further info or open an issue on GitHub for receiving assistance.
2023-09-13 19:08:02 | INFO | Optimizing with PyTorchTensorRTCompiler and q_type: None.
2023-09-13 19:08:04 | WARNING | Optimization failed with DeepLearningFramework.PYTORCH interface of ModelCompiler.TENSOR_RT_TORCH. Got error LitModel is not attached to a Trainer.. If possible the compilation will be re-scheduled with another interface. Please consult the documentation for further info or open an issue on GitHub for receiving assistance.
2023-09-13 19:08:05 | INFO | Optimizing with PyTorchTensorRTCompiler and q_type: QuantizationType.HALF.
2023-09-13 19:08:07 | WARNING | Optimization failed with DeepLearningFramework.PYTORCH interface of ModelCompiler.TENSOR_RT_TORCH. Got error LitModel is not attached to a Trainer.. If possible the compilation will be re-scheduled with another interface. Please consult the documentation for further info or open an issue on GitHub for receiving assistance.
2023-09-13 19:08:08 | INFO | [2/2] Running ONNX Optimization Pipeline
2023-09-13 19:08:08 | INFO | Optimizing with ONNXCompiler and q_type: None.
2023-09-13 19:08:10 | WARNING | TensorrtExecutionProvider for onnx is not available. If you want to use it, please add the path to tensorrt to the LD_LIBRARY_PATH environment variable. CUDA provider will be used instead.
2023-09-13 19:12:14 | INFO | Optimized model latency: 1.540417194366455 sec/iter
2023-09-13 19:12:14 | INFO | Optimizing with ONNXCompiler and q_type: QuantizationType.HALF.
It took 10 hours, and it's not over yet,why?