Skip to content
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

使用自己训练完成的权重 #7

Open
ZePher12138 opened this issue Aug 8, 2023 · 4 comments
Open

使用自己训练完成的权重 #7

ZePher12138 opened this issue Aug 8, 2023 · 4 comments

Comments

@ZePher12138
Copy link

大佬您好,如果我想使用自己训练的权重进行预测
model = torch.load('best.pt')
这样会报错,请问该如何修改呢

@killnice
Copy link
Owner

我不是大佬~
这样的报错是因为你自己训练的权重结构与我用的yolov5权重网络结构或版本不同,所以会报错
你可以尝试两种方法:

  1. 用我代码里yolov5的版本从新训练一次权重
  2. 把我的代码下载到本地之后,改造我的代码,主要是用你自己版本yolov5检测代码替换我代码里对应的部分

@lsh923
Copy link

lsh923 commented Sep 18, 2023

我把要訓練的圖像放進本地後,在本地開訓練檔結果報錯顯示
import val as validate # for end-of-epoch mAP
ModuleNotFoundError: No module named 'val'
然後我搜尋了隱藏檔有看到"/.cache/torch/hub/ultralytics_yolov5_master",看到裡面有train.py
那我要輸入哪些指令來進行訓練?

那如果改你的代碼的話,能大概講一下如何操做?

@respectNzy
Copy link

你好,请问解决“使用自己权重进行预测了吗”

@xinxinpeng
Copy link

您好,请问如何用您的yolov5版本重新训练一次权重呢?您这里没有train文件呀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants