youzhonghui / gate-decorator-pruning

Code for the NuerIPS'19 paper "Gate Decorator: Global Filter Pruning Method for Accelerating Deep Convolutional Neural Networks"
Apache License 2.0
196 stars 29 forks source link

TypeError: Object of type 'Config' is not JSON serializable #15

Closed niam06 closed 4 years ago

niam06 commented 4 years ago

Hi,

Thank you for your excellent work.

When running your "Command line (VGG-16) demo", I get a JSON encoder error in logger.py at line 63 under the save_network function - "TypeError: Object of type 'Config' is not JSON serializable". Can you please suggest a fix to this issue?

PS- I am using python 3.6.10 and PyTorch 1.0.1.post2.

Best, Niam

youzhonghui commented 4 years ago

Oh it's a bug caused by last code update. But don't worry, just run the command again to solve the problem. I will fix the code later.

niam06 commented 4 years ago

Thanks! Please give a shout here once you fix it :)

Ling27 commented 4 years ago

Hey, I experienced the same issue when saving the model (after 80 epochs) with command:

CUDA_VISIBLE_DEVICES=0 python main.py --config ./run/vgg16/baseline.json

Could you please fix the code? thank you in advance

youzhonghui commented 4 years ago

Already fixed. enjoy :D

priscillapan commented 4 years ago

still not correct。 logger.py L68 should be "json.dump(cfg.raw(), fp)" @youzhonghui

youzhonghui commented 4 years ago

Yes, you are right. Thank you very much!