0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DonkeyCar 3.1.0 処理時間を確認する

Last updated at Posted at 2019-08-25

目的

Vehicle.pyから呼び出される一連の処理は,DRIVE_LOOP_HZ が既定の 20 なら 50ms 以内に完了する.

モデルファイルによっては推論に時間が掛かることがあるのでこれをチェックする.

注:Tensorflow のバージョンが上がるにつれて推論の時間が長くなる傾向がある.

準備

manage.py を編集

V.start を呼び出す引数に「verbose=True」を追加する.

V.start(rate_hz=cfg.DRIVE_LOOP_HZ, 
        max_loop_count=cfg.MAX_LOOPS, verbose=True)

myconfig.pyでTrue/False設定可能にすると良い

確認方法

DonkeyCar動作中のターミナル画面に10秒ごとに

Part Profile Summary: (times in ms)
+------------------------------+--------+-------+-------+--------+
| part | max | min | avg | median |
+------------------------------+--------+-------+-------+--------+
| TubWriter | 17.31 | 2.86 | 4.16 | 3.81 |
| DualShock4JoystickController | 2.79 | 0.05 | 0.09 | 0.08 |
| ThrottleFilter | 1.62 | 0.03 | 0.03 | 0.03 |
| PilotCondition | 0.82 | 0.02 | 0.03 | 0.03 |
| FileWatcher | 6.34 | 0.08 | 0.15 | 0.12 |
| DriveMode | 9.17 | 0.04 | 0.20 | 0.17 |
| TriggeredCallback | 2.52 | 0.02 | 0.02 | 0.02 |
| DelayedTrigger | 0.63 | 0.02 | 0.03 | 0.03 |
| FileWatcher | 2.22 | 0.04 | 0.06 | 0.04 |
| PiCamera | 2.19 | 0.03 | 0.06 | 0.05 |
| ImgPreProcess | 11.34 | 1.15 | 1.60 | 1.46 |
| PWMSteering | 13.76 | 1.56 | 2.10 | 1.80 |
| PWMThrottle | 11.73 | 1.46 | 1.85 | 1.63 |
| KerasLinear | 74.78 | 35.61 | 49.87 | 49.08 |
| AiRecordingCondition | 7.80 | 0.02 | 0.03 | 0.03 |
| AiRunCondition | 5.98 | 0.02 | 0.03 | 0.03 |
+------------------------------+--------+-------+-------+--------+
のようなサマリーが表示される.
「Kerasxxx」の行が推論処理の時間.
また,

WARN::Vehicle: jitter violation in vehicle loop with value:

が表示されたら,処理時間をオーバーしている.

注:サマリーを算出する間はCPUが占有されループ処理が止まるので注意.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?