title: caffe python API for finetuning
body: <p>I know the command to fine tuning caffe model is like this:</p>
  
  <pre><code>caffe train -solver examples/finetuning_on_flickr_style/solver.prototxt -weights models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel
  </code></pre>
  
  <p>Because of some environment reasons(caffe install in root, python env install in user, when I using caffe command will always using root python env),  I cannot run caffe like this success, will get error like this:</p>
  
  <pre><code> File "/home/projec/test.py", line 8, in &lt;module&gt;
      import caffe
    File "/opt/caffe_gpu/python/caffe/__init__.py", line 1, in &lt;module&gt;
      from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
    File "/opt/caffe_gpu/python/caffe/pycaffe.py", line 11, in &lt;module&gt;
      import numpy as np
    File "/home/anaconda3/envs/python27/lib/python2.7/site-packages/numpy/__init__.py", line 142, in &lt;module&gt;
      from . import add_newdocs
    File "/home/anaconda3/envs/python27/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in &lt;module&gt;
      from numpy.lib import add_newdoc
    File "/home/anaconda3/envs/python27/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in &lt;module&gt;
      from .type_check import *
    File "/home/anaconda3/envs/python27/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in &lt;module&gt;
      import numpy.core.numeric as _nx
    File "/home/anaconda3/envs/python27/lib/python2.7/site-packages/numpy/core/__init__.py", line 74, in &lt;module&gt;
      from numpy.testing.nosetester import _numpy_tester
    File "/home/anaconda3/envs/python27/lib/python2.7/site-packages/numpy/testing/__init__.py", line 10, in &lt;module&gt;
      from unittest import TestCase
    File "/home/anaconda3/envs/python27/lib/python2.7/unittest/__init__.py", line 64, in &lt;module&gt;
      from .main import TestProgram, main
    File "/home/anaconda3/envs/python27/lib/python2.7/unittest/main.py", line 7, in &lt;module&gt;
      from . import loader, runner
    File "/home/anaconda3/envs/python27/lib/python2.7/unittest/runner.py", line 7, in &lt;module&gt;
      from .signals import registerResult
    File "/home/anaconda3/envs/python27/lib/python2.7/unittest/signals.py", line 2, in &lt;module&gt;
      import weakref
    File "/home/anaconda3/envs/python27/lib/python2.7/weakref.py", line 13, in &lt;module&gt;
      from _weakref import _remove_dead_weakref
  </code></pre>
  
  <p>Actually, When I type “from _weakref import _remove_dead_weakref” will not have error in python2.7 env:</p>
  
  <pre><code>Python 2.7.14 |Anaconda, Inc.| (default, Nov 20 2017, 18:04:19) 
  [GCC 7.2.0] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; from _weakref import _remove_dead_weakref
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>So, I using caffe in *.py file can train success,but I don't know what's the python API for "-weight" in the fine tuning command?The *.py file like this:</p>
  
  <pre><code>import caffe
  import numpy as np
  
  caffe.set_mode_gpu()
  caffe.set_device(0)
  solver= caffe.get_solver("/home/project/test.prototxt")
  solver.solve()
  </code></pre>
  
  <p>Can someone tell me how to set "weight" parameter in *.py file?</p>