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

Convert between new and old versions of state_dict #7

Open
USTCYYX opened this issue Feb 18, 2024 · 1 comment
Open

Convert between new and old versions of state_dict #7

USTCYYX opened this issue Feb 18, 2024 · 1 comment

Comments

@USTCYYX
Copy link

USTCYYX commented Feb 18, 2024

In ANN_SNN_QCFS/main_test, I find the code to convert the old version state_dict which train in code SNN_conversion_QCFS, to new version state_dict:

    for k in keys:
        if "relu.up" in k:
            state_dict[k[:-7]+'act.thresh'] = state_dict.pop(k)
        elif "up" in k:
            state_dict[k[:-2]+'thresh'] = state_dict.pop(k)

So if i can use the code

    for k in keys:
        if "relu.thresh" in k:
            state_dict[k[:-11]+'act.up'] = state_dict.pop(k)
        elif "thresh" in k:
            state_dict[k[:-6]+'up'] = state_dict.pop(k)

to convert the new version state_dict to the old version state_dict ? The old version state_dict can be tested in SNN_conversion_QCFS.

@putshua
Copy link
Owner

putshua commented Feb 21, 2024

I think that works. If you encounter any other problems after doing so, please let me know.

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

2 participants