Comments (5)
Now I understand what is happening, and this comment is just to register the solution (thanks to @marcoslucianops).
In your config_infer_primary_yolo.txt, the model-engine-file
always prevails over onnx-file. And in fact, despite my previous ignorance, it makes sense. The .engine file set by model-engine-file
is built from the onnx-file
, and the former is the one ran by Deepstream. Therefore, if .engine file exists, its is reasonable to Deepstream that it doesn't have to build it at all, just need to run it. I makes model loading pretty much faster and onnx-file
is ignored.
from deepstream-yolo.
You need to remove the engine file and generate the new one for the custom model.
from deepstream-yolo.
OK, just in case I removed all engine files and generated a new one, but the problem persists.
Take a look at this extract from label files of yolov5s.pt and my custom model epi.pt
yolov5s.pt labels epi.pt labels
person person
bicycle helmet
car suit
motorcycle boot
airplane gloves
bus mask
train glasses
truck earplug
boat
.....
And this is what I obtain when exporting epi.pt to epi.onnx. The DeepStream-Yolo folder now contains just the epi.onnx and label.txt. This is what I get:
Clearly, it is using the original weights, the ones from yolov5s. For instance, it detects an object whose class are bicycles ("1") and by label file says it is helmet, or an object belonging to trucks ("7") and my label file says it is an earplug. It look like it is ignoring my training and using just the original weights from yolov5s.
When I trained my custom model (epi.pt) I made a transfer learning from yolov5s. This is what I did for training my custom model (epi.pt): python3 train.py --img 640 --batch 16 --epochs 1000 --data epi.yaml --weights yolov5s.pt --cache --save-period 10
And this is what my custom model epi.pt returns when I run: python3 ~/yolov5/detect.py --weights epi.pt --source tegra.mp4
.
What's going wrong? Is the export script creating an incomplete onnx file?
from deepstream-yolo.
It's a very strange case, if you are using the correct onnx model and changing the labels.txt file, it should work without any issues.
from deepstream-yolo.
As I said, you need to take care about the engine file, because it could run the old file if you don't delete it, even changing the onnx model in the config_infer file.
from deepstream-yolo.
Related Issues (20)
- PTQ is too bad,QAT is future!So ,any idea for QAT support?
- Low frame rate YOLOv8, calibration int8 HOT 1
- Tensorrt is not able to parse onnx model
- RT-DETR PyTorch - ShapeInferenceError: Cannot export with --simplify for earlier versions of deepstream 6.0 HOT 16
- Support for deepstream 6.4 HOT 6
- ERROR from primary_gie: Failed to create NvDsInferContext instance HOT 5
- Parser make error: utils.h:36:10: fatal error: NvInfer.h: No such file or directory HOT 1
- Video Artifacts During Streaming with DeepStream
- Can I directly use the trt file exported by yolov7 as deepstream inference?
- Could not find Custom Engine Creation Function 'NvDsInferYoloCudaEngineGe' HOT 3
- NVDSINFER_CONFIG_FAILED when using 2+ video sources simultaneously HOT 5
- Discrepancies in Object Detection Results between Ultralytics and DeepStream at Yolov8
- Deepstream 6.4 does not work with YOLOv5 on Jetson in Docker
- failed to create NvDsinferContext instance, NvDsinfer Error: NVDSINFER_CONFIG_FAILED HOT 3
- How to use Python API to runtime multiple RTSP streams? HOT 1
- Model Export HOT 1
- Backend has maxBatchSize 1 whereas 2 has been requested, model_b2_gpu0_fp32.engine failed to match config params
- change config model from yolov5l to yolov8m
- yolov9 support ? HOT 7
- Sending Bounding Box info through UDP connection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepstream-yolo.