GithubHelp home page GithubHelp logo

yolov5-v6's People

Contributors

zju-lishuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yolov5-v6's Issues

关于copy_weight_v6()函数

您好,看了您的工程,大佬太厉害了!

有个问题想请教一下. 我训练好一个原始结构模型,然后用copy_weight_v6()生成一个新的模型,但是最后测试发现新生成的模型和原始的模型预测结果差很多,请问可能是什么问题导致的呢。

prune_finetune.py 执行时出现

optimizer: SGD with parameter groups 57 weight, 60 weight (no decay), 60 bias
DP not recommended, instead use torch.distributed.run for best DDP Multi-GPU results.
See Multi-GPU Tutorial at ultralytics/yolov5#475 to get started.
Traceback (most recent call last):
File "prune_finetune.py", line 678, in
main(opt)
File "prune_finetune.py", line 575, in main
train(opt.hyp, opt, device, callbacks)
File "prune_finetune.py", line 237, in train
model.module_list = model.module.module_list
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1178, in getattr
type(self).name, name))
AttributeError: 'Model' object has no attribute 'module_list'

执行稀疏训练时候出现了cfg文件不匹配的情况

作者你好,我在执行稀疏训练的时候,发现cfg文件的某些weight读出来是个空的sequential(),是cfg和pt不匹配的缘故吗:

command:

python train_sparsity.py --img 640 --batch 16 --epochs 10 --data yolo1104.yaml --cfg models/yolov5l.yaml --weights yolov5l.pt --name base_0225_sparsity --scale 0.001 --prune 1

log:

Model Summary: 468 layers, 46165219 parameters, 46165219 gradients, 108.0 GFLOPs

Transferred 606/613 items from yolov5l.pt
Scaled weight_decay = 0.0005
optimizer: SGD with parameter groups 101 weight, 104 weight (no decay), 104 bias
WARNING: smart bias initialization failure.
WARNING: smart bias initialization failure.
WARNING: smart bias initialization failure.
Traceback (most recent call last):
File "train_sparsity.py", line 672, in
main(opt)
File "train_sparsity.py", line 569, in main
train(opt.hyp, opt, device, callbacks)
File "train_sparsity.py", line 210, in train
copy_weight_v6(model, cfg_model)
File "/backup/yolov5_prune_0119/Normal_Dete/yolov5-v6/utils/model_transfer.py", line 85, in copy_weight_v6
idx=copy_c3(cspnet2,model.module_list,idx, round(3 * depth_multiple))
File "/backup/yolov5_prune_0119/Normal_Dete/yolov5-v6/utils/model_transfer.py", line 40, in copy_c3
idx=copy_conv_idx(c3_src.m[i].cv1, module_lists[idx],idx)
File "/backup/yolov5_prune_0119/Normal_Dete/yolov5-v6/utils/model_transfer.py", line 22, in copy_conv_idx
copy_conv(conv_src,conv_dst)
File "/backup/yolov5_prune_0119/Normal_Dete/yolov5-v6/utils/model_transfer.py", line 12, in copy_conv
conv_dst[0] = conv_src.conv
File "/root/miniconda3/envs/yolo/lib/python3.7/site-packages/torch/nn/modules/container.py", line 108, in setitem
key: str = self._get_item_by_idx(self._modules.keys(), idx)
File "/root/miniconda3/envs/yolo/lib/python3.7/site-packages/torch/nn/modules/container.py", line 96, in _get_item_by_idx
raise IndexError('index {} is out of range'.format(idx))
IndexError: index 0 is out of range

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.