プルーニング ループを開始する - 2.5 日本語

Vitis AI オプティマイザー ユーザー ガイド (UG1333)

Document ID
UG1333
Release Date
2022-06-15
Version
2.5 日本語

ana コマンドが正常に実行されたら、モデルのプルーニングを開始できます。prune コマンドは ana コマンドとよく似ており、同じコンフィギュレーション ファイルを使用します。

vai_p_tensorflow \
  --action=prune \
  --input_graph=inference_graph.pbtxt \
  --input_ckpt=model.ckpt \
  --output_graph=sparse_graph.pbtxt \
  --output_ckpt=sparse.ckpt \
  --workspace=/home/deephi/tf_models/research/slim \
  --sparsity=0.1 \
  --exclude="conv node names that excluded from pruning" \
  --output_nodes="output node names of the network"

このコマンドでは、次の引数も使用します。

--sparsity
プルーニング後のネットワークのスパース度。0 ~ 1 の値です。値が大きいほど、プルーニング後のモデルはよりスパースになります。

prune コマンドの実行後、vai_p_tensorflow はプルーニング前後のネットワークの FLOP 数を出力します。