ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.12k stars 16.19k forks source link

error appeared when detect #340

Closed zzy444626905 closed 4 years ago

zzy444626905 commented 4 years ago

(yolov3-pytorch) C:\Users\zzy\Desktop\darknet-pytorch\yolov5>python detect.py --weights weights/yolov3.pt --device cpu --source img/dog.jpg Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='cpu', img_size=640, iou_thres=0.5, output='inference/output', save_txt=False, source='img/dog.jpg', update=False, view_img=False, weights=['weights/yolov3.pt']) Using CPU

Traceback (most recent call last): File "detect.py", line 161, in detect() File "detect.py", line 23, in detect model = attempt_load(weights, map_location=device) # load FP32 model File "C:\Users\zzy\Desktop\darknet-pytorch\yolov5\models\experimental.py", line 133, in attempt_load model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval()) # load FP32 model AttributeError: 'collections.OrderedDict' object has no attribute 'float'

github-actions[bot] commented 4 years ago

Hello @zzy444626905, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

For more information please visit https://www.ultralytics.com.

zzy444626905 commented 4 years ago

ths very much!so sorry for that,this is my mistake,it run successfully,so fast and so better

glenn-jocher commented 4 years ago

@zzy444626905 great!

PromiseXu1 commented 3 years ago

@zzy444626905 I encounter the same problem when I detect, so how did you solve it? Thanks so much!

GuHuangAI commented 3 years ago

@zzy444626905 I encounter the same problem when I detect, so how did you solve it? Thanks so much!

when inference, if you use ensembel model, you --weights should input yolov5x.pt and yolov5l.pt simultaneously。