runtime.deserialize_cuda_engine(f.read())

When I use rhe function( runtime.deserialize_cuda_engine(f.read())), there was an error as follow:

Traceback (most recent call last):
File “main.py”, line 180, in
engine_data = load_engine(args.engine_file_path)
File “main.py”, line 136, in load_engine
return runtime.deserialize_cuda_engine(f.read())
TypeError: runtime_deserialize_legacy() missing 1 required positional argument: ‘size’

Did anyone have the same error?

Yes? I have the same error. But recently i didn’t. So why is this happened? Maybe some dependences are changed. Did you solve your problem?

Hi! I found the solution for me. it’s because I import tensorrt.legacy. It need just tensorrt without legacy. And it’s works)