Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'tensorrt_bindings.tensorrt.ICudaEngine' object has no attribute 'get_profile_shape' #321

Open
li8523892 opened this issue Apr 26, 2024 · 2 comments

Comments

@li8523892
Copy link

li8523892 commented Apr 26, 2024

一跑图就出现这个代码,不能出图。

@teywat
Copy link

teywat commented Jun 18, 2024

你是不是用的tensorrt 10.0.0b6?
我貌似解决这个问题了

@teywat
Copy link

teywat commented Jun 18, 2024

@li8523892
tensorrt貌似改了代码原来的不能用了,我查过tensorrt的文档后找到解决办法
在这个插件文件夹下面utilities.py中在代码最后将

def __str__(self):
        out = ""
        for opt_profile in range(self.engine.num_optimization_profiles):
            for binding in range(self.engine.num_io_tensors):
                name = self.engine.get_tensor_name(binding)
                shape = self.engine.get_tensor_profile_shape(opt_profile, name)
                out += f"\t{name} = {shape}\n"
        return out

替换为

def __str__(self):
        out = ""
        for opt_profile in range(self.engine.num_optimization_profiles):
            for binding in range(self.engine.num_io_tensors):
                name = self.engine.get_tensor_name(binding)
                shape = self.engine.get_tensor_profile_shape(name, opt_profile)
                out += f"\t{name} = {shape}\n"
        return out

可以正常绘图没有报错,具体是不是这个解题思路还得等作者确认

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

No branches or pull requests

2 participants