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

seg剪枝怎么改啊还是是这样 #5

Closed
1 task done
yinheyu opened this issue Jul 20, 2023 · 2 comments
Closed
1 task done

seg剪枝怎么改啊还是是这样 #5

yinheyu opened this issue Jul 20, 2023 · 2 comments
Labels
question Further information is requested Stale

Comments

@yinheyu
Copy link

yinheyu commented Jul 20, 2023

Search before asking

Question

   elif m is Segment:
        for j in range(3):
            ignore_idx.append(named_m_base + ".m.{}".format(j))
            from_to_map[named_m_base + ".m.{}".format(j)] = fromlayer[f[j]]
        for j in range(3):
            ignore_idx.append(named_m_base + ".proto.cv{}.conv".format(j))
            fromlayer.append(named_m_base + ".proto.cv{}.conv".format(j))

报错:
Traceback (most recent call last):
File "D:\YOLOv5-Light-main\pruning\slim.py", line 115, in
prune_and_export(model, ignore_idx, opt)
File "D:\YOLOv5-Light-main\pruning\slim.py", line 53, in prune_and_export
weights_inheritance(model, compact_model, from_to_map, maskbndict)
File "D:\YOLOv5-Light-main\utils\prune_utils.py", line 198, in weights_inheritance
former = from_to_map[layername]
KeyError: 'model.24.proto.cv1.conv'

Additional

No response

@yinheyu yinheyu added the question Further information is requested label Jul 20, 2023
@yinheyu yinheyu changed the title seg剪枝头是这样 seg剪枝怎么改啊还是是这样 Jul 20, 2023
@yinheyu
Copy link
Author

yinheyu commented Jul 20, 2023

elif m is Segment:
          for j in range(3):
              ignore_idx.append(named_m_base + ".proto.cv{}.conv".format(j))
              from_to_map[named_m_base + ".proto.cv{}.conv".format(j)] = fromlayer[f[j]]

Traceback (most recent call last):
File "D:\YOLOv5-Light-main\pruning\slim.py", line 115, in
prune_and_export(model, ignore_idx, opt)
File "D:\YOLOv5-Light-main\pruning\slim.py", line 53, in prune_and_export
weights_inheritance(model, compact_model, from_to_map, maskbndict)
File "D:\YOLOv5-Light-main\utils\prune_utils.py", line 198, in weights_inheritance
former = from_to_map[layername]
KeyError: 'model.24.m.0'

@github-actions
Copy link

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@github-actions github-actions bot added the Stale label Aug 20, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

1 participant