How can I prevent .solverstate based snapshots from being created?

516 views
Skip to first unread message

Hossein Hasanpour

unread,
Mar 27, 2016, 5:13:54 AM3/27/16
to Caffe Users
Hello all, Currently, two types of files are created whenever a snapshot needs to be saved to the disk.
one has a .caffemodel extension and the other one has the .solverstate extension which takes alot of space! (and this also slows down the overall operation since more time is consumed by the IO operation)
How can I specify that I dont need this solverstate file. and the ,caffemodel suffices for me ?

this is my current settings for snapshots :
# The maximum number of iterations
max_iter
: 60000
# snapshot intermediate results
snapshot
: 5000#40000
snapshot_prefix
: "examples/cifar10_full_relu_bn"
#snapshot_format: HDF5
# solver mode: CPU or GPU
solver_mode
: GPU

Thanks in advance

Silver Wave

unread,
Mar 27, 2016, 7:37:34 AM3/27/16
to Caffe Users
Please set:
snapshot: 0

Hossein Hasanpour

unread,
Mar 27, 2016, 8:11:10 AM3/27/16
to Caffe Users
I want the snapshot to be created, I dont plan on disabling it, I just dont need the solverstate getting generated along side the caffemodel.
Does this solve this problem?

Jan

unread,
Mar 30, 2016, 5:02:22 AM3/30/16
to Caffe Users
If you really need that I suggest changing the code of your caffe to simply not create a solverstate. Commenting Line 424 in solver.cpp should do the trick: https://github.com/BVLC/caffe/blob/master/src/caffe/solver.cpp#L424. If you are more ambitious and/or want/need more flexibility, you can also create an option in the proto to enable or disable saving of solverstates and implement the corresponding functionality. Shouldn't be too hard. And no, the snapshot: 0 will not do exactly that, it will simply disable saving snapshots at all (neither solverstate nor caffemodel are saved).

Jan
Reply all
Reply to author
Forward
0 new messages