cwq159 / PyTorch-Spiking-YOLOv3

A PyTorch implementation of Spiking-YOLOv3. Two branches are provided, based on two common PyTorch implementation of YOLOv3(ultralytics/yolov3 & eriklindernoren/PyTorch-YOLOv3), with support for Spiking-YOLOv3-Tiny at present.
GNU General Public License v3.0
208 stars 58 forks source link

load snn after convert #3

Open shirleyatgithub opened 3 years ago

shirleyatgithub commented 3 years ago

Dear author, is it able to load the transformed snn directly for inference? I tried to use codes similar to the following: if opt.weights_path.endswith(".weights"):

Load darknet weights

    model.load_darknet_weights(opt.weights_path)
else:
    # Load checkpoint weights
    model.load_state_dict(torch.load(opt.weights_path))

but when executing load_state_dict(snn_path), it reports an error that AttributeError: 'SpikeDAGModule' object has no attribute 'copy'. I wonder do you have any suggestions or any comments? Thanks a lot.

cwq159 commented 3 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

Sorry, I haven’t coded to load the transformed snn directly for inference, but just to test the mAP. I will add it later.Of course, u can try to code it! ^_^

                            Weiqian Chen

                                cwq@pku.edu.cn

    签名由
    网易邮箱大师
    定制

On 12/5/2020 20:19,shirleyatgithub<notifications@github.com> wrote: 

Dear author, is it able to load the transformed snn directly for inference? I tried to use codes similar to the following: if opt.weights_path.endswith(".weights"):

Load darknet weights

model.load_darknet_weights(opt.weights_path) else:

Load checkpoint weights

model.load_state_dict(torch.load(opt.weights_path)) but when executing load_state_dict(snn_path), it reports an error that AttributeError: 'SpikeDAGModule' object has no attribute 'copy'. I wonder do you have any suggestions or any comments? Thanks a lot.

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

JNaranjo-Alcazar commented 3 years ago

Hello author, I wonder if you may have an example or some code in order to use the generated files for inference/prediction. I have used this repository and I have created 3 files:

Any idea in how to used them?

Thanks a lot for your contribution!