WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.36k stars 4.22k forks source link

Yolo7 custom object detector - Xilinx VITIS-AI KV260 quantize #1650

Open feiticeir0 opened 1 year ago

feiticeir0 commented 1 year ago

Hi all. After created a custom detector using yolov7 and when trying it with detector.py everything works.

When I'm trying to quantize the model using Vitis-AI 3.0 to run on a Xilinx KV260 Vision Kit, I get the following error: [VAIQ_ERROR][QUANTIZER_TORCH_PYTORCH_TRACE]: Failed to get graph from model and input args. The PyTorch internal failed reason is: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

Why ? What could it be ?

I'm using CUDA .

Thank you

superkido511 commented 1 year ago

convert your input tensor to the same type as the model

Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

feiticeir0 commented 1 year ago

Hi ! thank you for the reply. But I'm using YOLOv7 train python file, so, could I change something there ? My model is generated by YOLOv7.

Thank you

zhz180 commented 10 months ago

Hi all. After created a custom detector using yolov7 and when trying it with detector.py everything works.

When I'm trying to quantize the model using Vitis-AI 3.0 to run on a Xilinx KV260 Vision Kit, I get the following error: [VAIQ_ERROR][QUANTIZER_TORCH_PYTORCH_TRACE]: Failed to get graph from model and input args. The PyTorch internal failed reason is: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

Why ? What could it be ?

I'm using CUDA .

Thank you

hello,have you solved the problem?