title: Running shell commands within Python, can not debug other Python modules called
body: <p>I call shell commands from a Python script (init) to caffe functions, this specific example trains a model using solver prototxt. What it does is to use caffe framework's built in functions, such as "train" and pass arguments. The train code is mainly built in C++ but it calls a Python script for a custom data layer. When I run the script below, it works, however I can not debug the custom Python data layer that is called by the training process. I have placed breakpoints and I try to run debug inline but it just works completely disregarding those breakpoints in the custom Python data layer. It only debugs the breakpoints in the init. I am using PyCharm. What can I do to debug this custom layer?</p>
  
  <pre><code># Make a copy of the current environment, then add a few additional variables
  env = os.environ.copy()
  env['HDF5_DISABLE_VERSION_CHECK'] = '1'
  env['PYTHONPATH'] = '.'
  env['GLOG_logtostderr'] = '1'
  
  subprocess.call([
  "sampleexact/samplepath/build/tools/caffe", "train", "-solver",
  "lstm_solver_flow.prototxt", "-weights",
  "single_frame_all_layers_hyb_flow_iter_50000.caffemodel"], env=env)
  </code></pre>