title: FCN in TensorFlow missing crop layer
body: <p>I am currently trying to implement <a href="http://www.cs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf" rel="noreferrer">FCN for semantic segmentation</a> in TensorFlow as it was previously done in Caffe <a href="https://github.com/shelhamer/fcn.berkeleyvision.org" rel="noreferrer">here</a>.</p>
  
  <p>Unfortunately I'm struggling with following 3 things:</p>
  
  <p>1) How to map "Deconvolution" layer from Caffe to TensorFlow? Is it correctly <code>tf.nn.conv2d_transpose</code>?</p>
  
  <p>2) How to map "Crop" layer from Caffe to TensorFlow? Unfortunately I can't see any alternative in TensorFlow. Is there equivalent for this in TensorFlow?</p>
  
  <p>3) Does Caffe <code>SoftmaxWithLoss</code> correspond to TensorFlow softmax_cross_entropy_with_logits?</p>
  
  <p>Thank you in advance for any advices, hints and help.</p>
  
  <p><strong>EDIT 9th May 2016:</strong></p>
  
  <p>1) I have found out that <code>tf.nn.conv2_transpose</code> really corresponds to deconvolution layer.</p>
  
  <p>2) Crop layer for now seems to be really a problem. I have found out that there actually exists <a href="https://www.tensorflow.org/versions/r0.8/api_docs/python/image.html#resize_image_with_crop_or_pad" rel="noreferrer"><code>tf.image.resize_image_with_crop_or_pad</code></a>, but this seems to be impossible to use for this purposes, because it can't work with dynamically created tensors nor with 4D tensors that you need to use after <code>tf.nn.conv2_transpose</code> layer.</p>
  
  <p>Some more information might be on: <a href="https://github.com/tensorflow/tensorflow/issues/2049" rel="noreferrer">https://github.com/tensorflow/tensorflow/issues/2049</a></p>
  
  <p><strong>EDIT 17th May 2016:</strong></p>
  
  <p>I have followed @24hours advice and build FCN in tensorflow, though I was not able to make it train on data of the arbitrary size.</p>
  
  <p>2) Crop layer is really not needed.</p>
  
  <p>3) I have used <code>tf.nn.sparse_softmax_cross_entropy_with_logits</code> at the end and it worked for me.</p>