Skip to content

❓ [Question] Can you convert model that operates on custom classes? #894

@MarekPokropinski

Description

@MarekPokropinski

❓ Question

I have a torch module that creates objects of custom classes that have tensors as fields. It can be torch.jit.scripted but torch.jit.trace can be problematic. When I torch.jit.script module and then torch_tensorrt.compile it I get the following error: Unable to get schema for Node %317 : __torch__.src.MyClass = prim::CreateObject() (conversion.VerifyCoverterSupportForBlock)

What you have already tried

torch.jit.trace avoids the problem but introduces problems with loops in module.

Environment

Build information about Torch-TensorRT can be found by turning on debug messages

  • PyTorch Version (e.g., 1.0): 1.10.2
  • CPU Architecture: intel
  • OS (e.g., Linux): linux
  • How you installed PyTorch (conda, pip, libtorch, source): pip
  • Build command you used (if compiling from source):
  • Are you using local sources or building from archives: from archives
  • Python version: 3.8
  • CUDA version: 11.3
  • GPU models and configuration: rtx 3090
  • Any other relevant information:

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions