Skip to content

AttributeError: 'tensorrt.tensorrt.Builder' object has no attribute 'max_workspace_size' #557

@weihaosky

Description

@weihaosky

When I run the Usage demo

import torch
from torch2trt import torch2trt
from torchvision.models.alexnet import alexnet

# create some regular pytorch model...
model = alexnet(pretrained=True).eval().cuda()

# create example data
x = torch.ones((1, 3, 224, 224)).cuda()

# convert to TensorRT feeding sample data as input
model_trt = torch2trt(model, [x])

An error occurs:

AttributeError                            Traceback (most recent call last)
~/Documents/github/fast-reid/demo/convert2trt.py in <module>
----> 1 model_trt = torch2trt(model_alex, [x])

~/anaconda3/envs/detect2/lib/python3.6/site-packages/torch2trt-0.2.0-py3.6.egg/torch2trt/torch2trt.py in torch2trt(module, inputs, input_names, output_names, log_level, max_batch_size, fp16_mode, max_workspace_size, strict_type_constraints, keep_network, int8_mode, int8_calib_dataset, int8_calib_algorithm, int8_calib_batch_size, use_onnx, **kwargs)
    546             ctx.mark_outputs(outputs, output_names)
    547 
--> 548     builder.max_workspace_size = max_workspace_size
    549     builder.fp16_mode = fp16_mode
    550     builder.max_batch_size = max_batch_size

AttributeError: 'tensorrt.tensorrt.Builder' object has no attribute 'max_workspace_size'

What is the problem? Many thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions