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

Pruning 段错误 #18

Closed
dengly opened this issue Dec 22, 2020 · 13 comments
Closed

Pruning 段错误 #18

dengly opened this issue Dec 22, 2020 · 13 comments

Comments

@dengly
Copy link

dengly commented Dec 22, 2020

我先是通过 python train.py --type mvocs 进行训练,再通过python3 train.py --type smvocs将上一步的best_mvocs.pt作为本次训练的输入模型,再通过python3 pruning.py -t 0.1将上一步的best_smvocs.pt作为本次的输入模型,运行python3 pruning.py -t 0.1就报段错误

@dengly
Copy link
Author

dengly commented Dec 22, 2020

python train.py --type mvocs 的 epochs是300
python train.py --type smvocs 的 epochs是100

@Syencil
Copy link
Owner

Syencil commented Dec 22, 2020

这描述给的信息太少了 尝试单步debug吧 我这边流程是没问题

@dengly
Copy link
Author

dengly commented Dec 22, 2020

这描述给的信息太少了 尝试单步debug吧 我这边流程是没问题

确认一下我这样的操作是否正常

@dengly
Copy link
Author

dengly commented Dec 22, 2020

这个是我执行的脚步

# 训练 Baseline
python train.py --type mvocs

# 稀疏 sparse learning
python3 train.py --type smvocs

# 剪枝 Pruning
python3 pruning.py -t 0.1

# 微调 finetune
python3 train.py --type fsmvocs

# 蒸馏 Distillation
python3 train.py --type dmvocs

@dengly
Copy link
Author

dengly commented Dec 22, 2020

我修改了 cfg、data、weights、epochs、batch_size

@dengly
Copy link
Author

dengly commented Dec 22, 2020

baseline用的模型是 mobilenet_v2-b0353104.pth,后续的都是上一次训练得到的best模型,到pruning这步就这样了。我尝试重新训练看看是否正常

@TongShuo-Demon
Copy link

这个是我执行的脚步

# 训练 Baseline
python train.py --type mvocs

# 稀疏 sparse learning
python3 train.py --type smvocs

# 剪枝 Pruning
python3 pruning.py -t 0.1

# 微调 finetune
python3 train.py --type fsmvocs

# 蒸馏 Distillation
python3 train.py --type dmvocs

能问问您关于这个数据集放置的问题吗

@Syencil
Copy link
Owner

Syencil commented Dec 23, 2020

走debug吧 看是哪个位置错了

@dengly
Copy link
Author

dengly commented Dec 24, 2020

定位的执行bn_analyze方法的plt.hist(bn_val, bins=101, align="mid", log=True, range=(0, 1.0))报错

@Syencil
Copy link
Owner

Syencil commented Dec 24, 2020

如果是服务器terminal应该不带显示功能吧 plt的问题

@dengly
Copy link
Author

dengly commented Dec 24, 2020

定位到是matplotlib.pyplot相关方法调用报错,我注掉后使用IDEA运行正常,但是通过终端执行还是会报段错误。

@dengly
Copy link
Author

dengly commented Dec 24, 2020

如果是服务器terminal应该不带显示功能吧 plt的问题

我用的是深度的系统,deepin v20

@TongShuo-Demon
Copy link

test.py文件使用剪枝后的模型会报错,报错信息如下:
Traceback (most recent call last):
File "/home/demon/PycharmProjects/mobile-yolov5-pruning-distillation/test.py", line 357, in
test(opt.data,
File "/home/demon/PycharmProjects/mobile-yolov5-pruning-distillation/test.py", line 89, in test
names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)}
File "/home/demon/anaconda3/envs/pytorch_gpu/lib/python3.8/site-packages/torch/nn/modules/module.py", line 771, in getattr
raise ModuleAttributeError("'{}' object has no attribute '{}'".format(
torch.nn.modules.module.ModuleAttributeError: 'Model' object has no attribute 'module'

@Syencil Syencil closed this as completed Apr 14, 2021
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

3 participants