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

yolo11 如何修改转换精度 #1599

Open
zoeyluckforever opened this issue Nov 4, 2024 · 1 comment
Open

yolo11 如何修改转换精度 #1599

zoeyluckforever opened this issue Nov 4, 2024 · 1 comment

Comments

@zoeyluckforever
Copy link

Env

  • windows
  • GPU, RTX4070,
  • OS, e.g. Ubuntu16.04, Win10, etc.
  • Cuda version 11.8
  • TensorRT version 8.6.1.6

Your problem

python gen_wts.py -w yolo11n.pt -o yolo11n.wts -t detect Generating .wts for detect model

gen_wts.py:41: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
model = torch.load(pt_file, map_location=device)['model'].float() # load to FP32

c++ 转换engine
[11/05/2024-00:48:35] [W] [TRT] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
Loading weights: yolo11n.wts
Your platform support int8: true
Building engine, please wait for a while...
reading calib cache: int8calib.table
[11/05/2024-00:48:42] [W] [TRT] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
[11/05/2024-00:48:42] [E] [TRT] 1: Unexpected exception invalid unordered_map<K, T> key
Build engine successfully!
Assertion failed: serialized_engine, file tensorrtx-master\yolo11\yolo11_det.cpp, line 24

@wang-xinyu
Copy link
Owner

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