Skip to content

Conversation

@jeffdonahue
Copy link
Contributor

This PR uses the new ShareData method of blobs to implicitly copy parameter blobs (weights/biases) from the train net to the test net. I tested the imagenet model on GPU to confirm that memory is saved (233 MB, which makes sense as this is roughly the size of the saved imagenet parameters) once the test net is initialized:

dev: before test net initialization: 64% GPU memory use: 3074 MB / 4799 MB after test net initialization: 74% GPU memory use: 3548 MB / 4799 MB share-trained-layers: before test net initialization: 64% GPU memory use: 3074 MB / 4799 MB after test net initialization: 69% GPU memory use: 3315 MB / 4799 MB 

Note that the test net initialization still uses extra memory because its data blobs (which store bottom/top inputs/outputs in each layer) are still allocated.

jeffdonahue added a commit that referenced this pull request Apr 18, 2014
add ShareTrainedLayersWith method and use for test net in solver
@jeffdonahue jeffdonahue merged commit 9ad2422 into BVLC:dev Apr 18, 2014
@jeffdonahue jeffdonahue deleted the share-trained-layers branch April 22, 2014 04:46
@shelhamer shelhamer mentioned this pull request May 20, 2014
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
add ShareTrainedLayersWith method and use for test net in solver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant