Forums - FCN caffemodel convert to .dlc fail

1 post / 0 new
FCN caffemodel convert to .dlc fail
coders
Join Date: 9 Jun 16
Posts: 4
Posted: Tue, 2017-08-08 18:59
Dear qcom,
 
I want to convert FCN cafeemodel to snpe model,but it's fail when i do it.
 
I check the convert code in snpe_caffe_to_dlc.py:
 
..........
# Loop through layers
        if len(self.spec.layers) == 0:
            self.convert_caffe_new(self.spec)
        else:
            self.convert_caffe_old(self.spec)
..........
 
Because of my network is described by the layers and have crop layer,
so will run the code  :self.convert_caffe_old(self.spec)
 
But there is no self.add_crop_layer(layer) in the funtion convert_caffe_old 
 
I try to add self.add_crop_layer(layer) in the funtion self.convert_caffe_old(self.spec)
 
def convert_caffe_old( self, spec ):
       ......
        for layer in spec.layers:
            typ = layer.type
            self._network_topology.add_layer(layer, str(layer.type))
            if typ == layer.CONCAT:
                self.add_concat_layer(layer)
....
            elif typ == layer.CROP:
                self.add_crop_layer(layer)
            elif typ == layer.ELTWISE:
                self.add_elementwise_layer(layer)
 
But appear the following error:
Encountered Error: 'V1LayerParameter' object has no attribute 'crop_param'
I check the code /caffe/src/caffe/proto/caffe.proto:
message V1LayerParameter {
  repeated string bottom = 2;
  repeated string top = 3;
  optional string name = 4;
  repeated NetStateRule include = 32;
  ......
 
  optional ExpParameter exp_param = 41;
  optional HDF5DataParameter hdf5_data_param = 13;
  optional HDF5OutputParameter hdf5_output_param = 14;
  optional HingeLossParameter hinge_loss_param = 29;
  optional ImageDataParameter image_data_param = 15;
  optional InfogainLossParameter infogain_loss_param = 16;
}
  
There is really no crop_param.
 
Is there a solution to slove this problem?
 
Thanks in advance.

 

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.