TensorRT:Invalid axis in softmax layer

 嘗試了一下 RepVGG-A0 的TensorRT序列化,遇到了下面這個問題:

Caffe Parser: Invalid axis in softmax layer - TensorRT expects NCHW input. Negative axis is not supported in TensorRT, please use positive axis indexing
error parsing layer type Softmax

看了一下prototxt: softmax前面,只有 Reshape layer裏面是沒有顯示的指定NCHW【-1表示是自己推理處理】。

所以,稍微調整一下Reshape layer,將缺省維度參數補全即可:

 

layer {
  name: "view1"
  type: "Reshape"
  bottom: "ave_pool_blob1"
  top: "view_blob1"
  reshape_param {
    shape {
      dim: 0
      dim: -1
      dim: 1
      dim: 1
    }
  }
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章