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

构建engine失败,返回None #585

Open
jishenghuang opened this issue Nov 27, 2024 · 0 comments
Open

构建engine失败,返回None #585

jishenghuang opened this issue Nov 27, 2024 · 0 comments

Comments

@jishenghuang
Copy link

Traceback (most recent call last):
File "/workspace/ppq/ppq/samples/TensorRT/Example_Fp32.py", line 17, in
builder.create_engine(engine_path='Output/yolov8s.engine', precision="fp16")
File "/workspace/ppq/ppq/samples/TensorRT/trt_infer.py", line 259, in create_engine
log.info("Serializing engine to file: {:}".format(engine_path))
AttributeError: 'NoneType' object has no attribute 'serialize'
我发现 是这里的engine返回值为None,怎么解决呢
engine = self.builder.build_engine(self.network, self.config)
print(engine)
if not engine:
log.error("Failed to build the TensorRT engine")
with open(engine_path, "wb") as f:
log.info("Serializing engine to file: {:}".format(engine_path))
f.write(engine.serialize())

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

1 participant