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

ERROR occurred when loading torch model(.pth) using torch2trt.TRTModule #537

Closed
kenzoukun opened this issue Mar 31, 2021 · 1 comment
Closed

Comments

@kenzoukun
Copy link

[TensorRT] ERROR: ../rtSafe/coreReadArchive.cpp (31) - Serialization Error in verifyHeader: 0 (Magic tag does not match)
[TensorRT] ERROR: INVALID_STATE: std::exception
[TensorRT] ERROR: INVALID_CONFIG: Deserialize the cuda engine failed.
Traceback (most recent call last):
File "iva.py", line 39, in
model_trt.load_state_dict(torch.load(OPTIMIZED_MODEL))

loading codes:

from torch2trt import TRTModule
OPTIMIZED_MODEL = 'resnet18_baseline_att_224x224_A_epoch_249_trt.pth'
model_trt = TRTModule()
model_trt.load_state_dict(torch.load(OPTIMIZED_MODEL))

thanks~

@kenzoukun
Copy link
Author

The error has been resolved, refer to#32

@kenzoukun kenzoukun changed the title ERROR happened when loading torch model(.pth) using torch2trt.TRTModule ERROR occurred when loading torch model(.pth) using torch2trt.TRTModule Mar 31, 2021
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