-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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
yolov5 Tensortt errors ? #13057
Comments
👋 Hello @Janeqs-cx, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. RequirementsPython>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit. Introducing YOLOv8 🚀We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀! Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects. Check out our YOLOv8 Docs for details and get started with: pip install ultralytics |
already did this 💀 |
It seems like you've already tried some troubleshooting steps. Could you please specify which steps you've taken so far? This will help us provide more targeted assistance. Thank you! |
I reinstalled whole Tensort Pytorch And cuda cudnn i tried also making a new model but it also failed and now i really dont know why it's not working i also tried yolov5 older versions like v6.2 |
Thank you for detailing the steps you've taken. It sounds like you've already tried a comprehensive set of troubleshooting actions. Let's try a couple more things:
If these steps don't resolve the issue, could you provide the exact command or script you are using to run the inference? This might help pinpoint where things are going wrong. |
Reinstalled numpy + Checked TensortRT Engine to check i corrupted and also reinstalled whole python venv |
Hi @glenn-jocher i just changed some version of dependecies and now throwwing these errors : YOLOv5 v7.0-318-gc0380fd8 Python-3.9.13 torch-1.12.1+cu116 CUDA:0 (NVIDIA GeForce GTX 1060 6GB, 6144MiB) Loading C:\Users\Janek\Desktop\Val-sz\best.engine for TensorRT inference... |
Hi @Janeqs-cx, It looks like the input image size does not match the expected size by the model. The model is expecting an input size of (1, 3, 736, 736), but it received an input size of (1, 3, 384, 640). Please ensure that the input images are resized or padded to match the model's expected input dimensions of 736x736 before passing them to the model. This adjustment should resolve the assertion error you're encountering. Let us know if you need further assistance! |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
Hey @Janeqs-cx, regarding your original error. I have also faced the similar issue. installing numpy==1.23 before exporting to tensorrt format resolved the issue for me (I have tested it on colab) |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
Search before asking
Question
I was trying to run tensort with my trained best.engine version. I checked best.engine file and it's working fine with tensort but when tried to run with script by yolov5 it's give these errors :
PS C:\Users\Janek\Desktop\Val-sz> & c:/Users/Janek/Desktop/Val-sz/cheats-env/Scripts/python.exe c:/Users/Janek/Desktop/Val-sz/scripts/dxcam_main.py
YOLOv5 2022-11-22 Python-3.10.5 torch-1.12.1+cu116 CUDA:0 (NVIDIA GeForce GTX 1060 6GB, 6144MiB)
Loading C:\Users\Janek\Desktop\Val-sz\scripts\best.engine for TensorRT inference...
[05/31/2024-21:01:11] [TRT] [I] [MemUsageChange] Init CUDA: CPU +297, GPU +0, now: CPU 11292, GPU 1015 (MiB)
[05/31/2024-21:01:11] [TRT] [I] Loaded engine size: 10 MiB
[05/31/2024-21:01:11] [TRT] [I] [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +0, now: CPU 0, GPU 0 (MiB)
[05/31/2024-21:01:11] [TRT] [I] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +0, now: CPU 0, GPU 0 (MiB)
C:\Users\Janek\Desktop\Val-sz\cheats-env\lib\site-packages\tensorrt_init_.py:331: FutureWarning: In the future
np.bool
will be defined as the corresponding NumPy scalar.bool: np.bool,
Traceback (most recent call last):
File "C:\Users\Janek\Desktop\Val-sz\yolov5\hubconf.py", line 49, in create
model = DetectMultiBackend(path, device=device, fuse=autoshape) # detection model
File "C:\Users\Janek\Desktop\Val-sz\yolov5\models\common.py", line 406, in init
dtype = trt.nptype(model.get_binding_dtype(i))
File "C:\Users\Janek\Desktop\Val-sz\cheats-env\lib\site-packages\tensorrt_init.py", line 331, in nptype
bool: np.bool,
File "C:\Users\Janek\Desktop\Val-sz\cheats-env\lib\site-packages\numpy_init_.py", line 338, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'bool'.
np.bool
was a deprecated alias for the builtinbool
. To avoid this error in existing code, usebool
by itself. Doing this will not modify any behavior and is safe. If you specificallywanted the numpy scalar type, use
np.bool_
here.The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'bool_'?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Janek\Desktop\Val-sz\yolov5\hubconf.py", line 60, in _create
model = attempt_load(path, device=device, fuse=False) # arbitrary model
File "C:\Users\Janek\Desktop\Val-sz\yolov5\models\experimental.py", line 79, in attempt_load
ckpt = torch.load(attempt_download(w), map_location='cpu') # load
File "C:\Users\Janek\Desktop\Val-sz\cheats-env\lib\site-packages\torch\serialization.py", line 713, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\Janek\Desktop\Val-sz\cheats-env\lib\site-packages\torch\serialization.py", line 920, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: unpickling stack underflow
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Users\Janek\Desktop\Val-sz\scripts\dxcam_main.py", line 104, in
model = torch.hub.load(r'C:\Users\Janek\Desktop\Val-sz\yolov5' , 'custom', path= r'C:\Users\Janek\Desktop\Val-sz\scripts\best.engine',source='local').cpu()
File "C:\Users\Janek\Desktop\Val-sz\cheats-env\lib\site-packages\torch\hub.py", line 540, in load
model = _load_local(repo_or_dir, model, *args, **kwargs)
File "C:\Users\Janek\Desktop\Val-sz\cheats-env\lib\site-packages\torch\hub.py", line 569, in _load_local
model = entry(*args, **kwargs)
File "C:\Users\Janek\Desktop\Val-sz\yolov5\hubconf.py", line 83, in custom
return _create(path, autoshape=autoshape, verbose=_verbose, device=device)
File "C:\Users\Janek\Desktop\Val-sz\yolov5\hubconf.py", line 78, in _create
raise Exception(s) from e
Exception: unpickling stack underflow. Cache may be out of date, try
force_reload=True
or see #36 for help.Can someone explain and help me fix it?
Additional
No response
The text was updated successfully, but these errors were encountered: