longcw / pytorch2caffe

Convert PyTorch model to Caffemodel
541 stars 151 forks source link

ExpandBackward #29

Closed yangninghua closed 5 years ago

yangninghua commented 5 years ago

layer_dict = {'ConvNdBackward': 'Convolution', 'ThresholdBackward': 'ReLU', 'MaxPool2dBackward': 'Pooling', 'AvgPool2dBackward': 'Pooling', 'DropoutBackward': 'Dropout', 'AddmmBackward': 'InnerProduct', 'BatchNormBackward': 'BatchNorm', 'AddBackward': 'Eltwise', 'ViewBackward': 'Reshape', 'ConcatBackward': 'Concat', 'UpsamplingNearest2d': 'Deconvolution', 'UpsamplingBilinear2d': 'Deconvolution', 'SigmoidBackward': 'Sigmoid', 'LeakyReLUBackward': 'ReLU', 'NegateBackward': 'Power', 'MulBackward': 'Eltwise', 'SpatialCrossMapLRNFunc': 'LRN',

          'ExpandBackward': 'Dropout',
          'ThnnConv2DBackward': 'Dropout',
          'ThnnBatchNormBackward': 'Dropout',
          'ThMulBackward': 'Dropout',
          'ConstantPadNdBackward': 'Dropout',
          'SliceBackward': 'Dropout',
          'CloneBackward': 'Dropout',
          'CatBackward': 'Dropout',
          'AdaptiveAvgPool2DBackward': 'Dropout',
          'ThAddBackward': 'Dropout',
          'SqueezeBackward1': 'Dropout',
          'TBackward': 'Dropout',
          'ThAddmmBackward': 'Dropout'
          }
yangninghua commented 5 years ago
    elif parent_type == 'ExpandBackward':
        aa = 1
    elif parent_type == 'ThnnConv2DBackward':
        aa = 1
    elif parent_type == 'ThnnBatchNormBackward':
        aa = 1
    elif parent_type == 'ThMulBackward':
        aa = 1
    elif parent_type == 'ConstantPadNdBackward':
        aa = 1
    elif parent_type == 'SliceBackward':
        aa = 1
    elif parent_type == 'CloneBackward':
        aa = 1
    elif parent_type == 'CatBackward':
        aa = 1
    elif parent_type == 'AdaptiveAvgPool2DBackward':
        aa = 1
    elif parent_type == 'ThAddBackward':
        aa = 1
    elif parent_type == 'SqueezeBackward1':
        aa = 1
    elif parent_type == 'TBackward':
        aa = 1
    elif parent_type == 'ThAddmmBackward':
        aa = 1
yangninghua commented 5 years ago

pytorch >= 0.4.1

konioyxgq commented 5 years ago

@yangninghua,it real work?