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

Attribute error _enter_ when running int8 compilation #37

Open
harishprabhala opened this issue May 31, 2022 · 2 comments
Open

Attribute error _enter_ when running int8 compilation #37

harishprabhala opened this issue May 31, 2022 · 2 comments

Comments

@harishprabhala
Copy link

I am getting this error while compiling for int8. The same code works fine for FP32 and FP16

[05/31/2022-05:46:12] [TRT] [E] 1: Unexpected exception 
Traceback (most recent call last):
  File "./onnx_to_tensorrt.py", line 218, in <module>
    main()
  File "./onnx_to_tensorrt.py", line 213, in main
    with builder.build_engine(network, config) as engine, open(args.output, "wb") as f:
AttributeError: __enter__
@CharlesNord
Copy link

I encountered with the same issue, did you solve it ?

I can generate the desired model by command line, but cannot use python api.

@CharlesNord
Copy link

I finally solved the problem,

Just delete the pycuda.autoinit in ImagenetCalibrator.py and add it in the beginning of the onnx_to_tensor.py the generated engine should live in the CUDA context created by the pycuda

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