diff --git a/02_training_corrected.ipynb b/02_training_corrected.ipynb index 656b8d7925604f26e7f72f9c20ace58255634866..a5bcc90c85579e0530c1d0e058a2d54ab4b41d77 100644 --- a/02_training_corrected.ipynb +++ b/02_training_corrected.ipynb @@ -65,7 +65,11 @@ "outputs": [], "source": [ "def read_data_from_json(image):\n", - " with open(image_path/f'{image.stem}.json') as f:\n", + " json_src = image_path/f'{image.stem}.json'\n", + " if not json_src.exists():\n", + " json_src_name = image.stem.replace('picture', 'data')\n", + " json_src = image_path/f'{json_src_name}.json'\n", + " with open(json_src) as f:\n", " json_file = json.load(f)\n", " return[float(json_file['throttle']), float(json_file['steering'])]" ]