#๐ I need help updating a yolo model
56 messages ยท Page 1 of 1 (latest)
@sullen berry
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
So, by database do you mean weights?
self.model = torch.hub.load('ultralytics/yolov5', 'custom', path='lib/best.pt', force_reload = True)
this is how the database is loaded at the moment
there is just a file named best.pt
no weights
but i would like to replace yolov5 with yolov8 and use a new pretrained database
which i have
are you able to help? @sudden kayak
So the .pt file is usually regarded as the weights. It's not really a database as most people would think of a database.
You should just be able to repalce the path= argument with the new pre-trained weights file
i dont have the weights file
i need help transferring it to a weights file and implementing it into the code in replacement of this
The .pt file is the weights file
For yolov8, what files do you have with it?
this is the dataset i would like to use
Is this for malicious purposes?
no
So you want to train and create your own new weights file using yolov8?
yes
what's your goal with using this dataset in particular?
me and my friend are creating an ai detection for fortnite, its a project between only us two and will not be made public
there is no "malicious purpose" of this project, its just experimental
does it actually have any input on the game or is inserted in the game itself in anyway or is it being fed a screen capture?
there are no connections with the game whatsoever
it doesnt tamper with any files, it just detects players in a snippet of the screen
its very interesting to us
alright, i was asking because if it did it would break their tos making it so we arent allowed to help. as long as its only a snippet its fine
So, if you want to train a new thing with yolov8 and that dataset, then you need to replace the first argument with the actual yolov8 model. The starting weight file don't make a huuuge difference tbh if you're going to re-train if you tune your training well enough.
can you please help me with this? i have tried to replace the line of code with my own but it didnt work
what did you replace it with?
Well, do you have the yolov8 model downloaded/accessible?
yes
here
i have downloaded it as a zip file
So that's the weights file using the format yolov8 needs, but it's not the actual yolov8 model itself. Just the weights file trained with that dataset.
im sorry that i am so confused
how would i form the model
from the weights file
i need to make this into a model (.pt file)
https://universe.roboflow.com/james-pakis/fortnite-player-detection-hpiac/dataset/8
and integrate it so that pt file replaces the one in this
self.model = torch.hub.load('ultralytics/yolov5', 'custom', path='lib/best.pt', force_reload = True)
and change yolov5 to yolov8
You can't. You need to download the yolov8 model from wherever it's originally hosted. The model can create the weights file after a sufficient amount of training.
From this: self.model = torch.hub.load('ultralytics/yolov5', 'custom', path='lib/best.pt', force_reload = True)
You should just need to repalce ultralytics/yolov5 with ultralytics/yolov8 (https://github.com/ultralytics/ultralytics)
Ah, it looks like ultralytics dropped torch hub support for v8. You'll have to follow their docs to load in yolov8 https://docs.ultralytics.com/modes/train/#resuming-interrupted-trainings
so would i replace
self.model = torch.hub.load('ultralytics/yolov5', 'custom', path='lib/best.pt', force_reload = True)
with
model = YOLO('best.pt') # load a partially trained model
after i have imported yolo from ultralytics of course
I'm not familiar with using their platform, you'd have to follow their guide for using it
ok thank you for the help
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.