1、转IR
mmtoir/python3 -m mmdnn.conversion._script.convertToIR
python3 -m mmdnn.conversion._script.convertToIR -f mxnet -n model-symbol.json -w model-0000.params --inputShape 3,112,112 -o IR34
输出:
UserWarning: You created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
data
warnings.warn(msg)
Warning: MXNet Parser has not supported operator null with name data.
Warning: convert the null operator with name [data] into input layer.
IR network structure is saved as [IR34.json].
IR network structure is saved as [IR34.pb].
IR weights are saved as [IR34.npy]
2、IR转输出模型Code
mmtocode/python3 -m mmdnn.conversion._script.IRToCode
python3 -m mmdnn.conversion._script.IRToCode -f pytorch --IRModelPath IR34.pb --IRWeightPath IR34.npy -o IR34-2.py -dw IR34-2.npy