fix caffe train GPU initialization

Previously, the solver constructed nets before the caffe train tool read
the --gpu flag, which can cause errors due to LayerSetUp executing on
the wrong device (breaking cuDNN, for example).
Merge pull request #1083 from longjon/fix-solver-gpu-init

Fix solver GPU initialization order (e.g., training with cuDNN on non-default device)
Merge remote-tracking branch 'upstream/dev' into dev
start creating labeling_loss_layer