diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 6b0311720..fd03481ab 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Create python 3.9 conda env + - name: Create python 3.11 conda env uses: conda-incubator/setup-miniconda@v3 with: - python-version: 3.9 + python-version: 3.11 mamba-version: "*" activate-environment: donkey auto-activate-base: false diff --git a/donkeycar/__init__.py b/donkeycar/__init__.py index 69d83cf52..aae7c9c76 100644 --- a/donkeycar/__init__.py +++ b/donkeycar/__init__.py @@ -3,7 +3,7 @@ from pyfiglet import Figlet import logging -__version__ = '5.1.dev0' +__version__ = '5.1.dev1' logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO').upper()) @@ -13,8 +13,8 @@ print(f.renderText('Donkey Car')) print(f'using donkey v{__version__} ...') -if sys.version_info.major < 3 or sys.version_info.minor < 8: - msg = f'Donkey Requires Python 3.8 or greater. You are using {sys.version}' +if sys.version_info.major < 3 or sys.version_info.minor < 11: + msg = f'Donkey Requires Python 3.11 or greater. You are using {sys.version}' raise ValueError(msg) # The default recursion limits in CPython are too small. diff --git a/donkeycar/management/ui.kv b/donkeycar/management/ui.kv index 96d72e9a4..34eeadd32 100644 --- a/donkeycar/management/ui.kv +++ b/donkeycar/management/ui.kv @@ -104,7 +104,7 @@ valign: 'middle' font_size: 14 if platform == 'linux' else 28 size_hint_x: 0.8 - padding_x: 10 + padding: 10, 0 canvas.before: Color: rgba: 0.14, 0.15, 0.22, 1 diff --git a/donkeycar/parts/pytorch/torch_train.py b/donkeycar/parts/pytorch/torch_train.py index 844b68ade..7413b0009 100644 --- a/donkeycar/parts/pytorch/torch_train.py +++ b/donkeycar/parts/pytorch/torch_train.py @@ -46,8 +46,8 @@ def train(cfg, tub_paths, model_output_path, model_type, checkpoint_path=None): if cfg.PRINT_MODEL_SUMMARY: summarize(model) - trainer = pl.Trainer(gpus=gpus, logger=logger, max_epochs=cfg.MAX_EPOCHS, - default_root_dir=output_dir) + trainer = pl.Trainer(accelerator='cpu', logger=logger, + max_epochs=cfg.MAX_EPOCHS, default_root_dir=output_dir) data_module = TorchTubDataModule(cfg, tub_paths) trainer.fit(model, data_module) diff --git a/donkeycar/parts/telemetry.py b/donkeycar/parts/telemetry.py index f6a32aaca..64d7c40ec 100644 --- a/donkeycar/parts/telemetry.py +++ b/donkeycar/parts/telemetry.py @@ -14,6 +14,7 @@ import numpy as np from logging import StreamHandler from paho.mqtt.client import Client as MQTTClient +from paho.mqtt.enums import CallbackAPIVersion logger = logging.getLogger() @@ -40,7 +41,7 @@ def __init__(self, cfg): self._mqtt_broker = os.environ.get('DONKEY_MQTT_BROKER', cfg.TELEMETRY_MQTT_BROKER_HOST) # 'iot.eclipse.org' self._topic = cfg.TELEMETRY_MQTT_TOPIC_TEMPLATE % self._donkey_name self._use_json_format = cfg.TELEMETRY_MQTT_JSON_ENABLE - self._mqtt_client = MQTTClient() + self._mqtt_client = MQTTClient(callback_api_version=CallbackAPIVersion.VERSION2) self._mqtt_client.connect(self._mqtt_broker, cfg.TELEMETRY_MQTT_BROKER_PORT) self._mqtt_client.loop_start() self._on = True diff --git a/donkeycar/tests/test_telemetry.py b/donkeycar/tests/test_telemetry.py index 872cf8620..02a8f6907 100644 --- a/donkeycar/tests/test_telemetry.py +++ b/donkeycar/tests/test_telemetry.py @@ -3,9 +3,10 @@ import time from unittest import mock from paho.mqtt.client import Client +from paho.mqtt.enums import CallbackAPIVersion + import donkeycar.templates.cfg_complete as cfg from donkeycar.parts.telemetry import MqttTelemetry -import pytest from random import randint @@ -16,11 +17,8 @@ def test_mqtt_telemetry(): cfg.TELEMETRY_MQTT_JSON_ENABLE = True # Create receiver - sub = Client(clean_session=True) - - # def on_message(client, userdata, message): - # data = message.payload - # print(message) + sub = Client(callback_api_version=CallbackAPIVersion.VERSION2, + clean_session=True) on_message_mock = mock.Mock() sub.on_message = on_message_mock diff --git a/donkeycar/tests/test_torch.py b/donkeycar/tests/test_torch.py index 3137e50dd..f6bdd2193 100644 --- a/donkeycar/tests/test_torch.py +++ b/donkeycar/tests/test_torch.py @@ -109,7 +109,7 @@ def test_training_pipeline(config: Config, model_type: str, car_dir: str) \ gpus = 0 # Overfit the data - trainer = pl.Trainer(gpus=gpus, overfit_batches=2, max_epochs=30) + trainer = pl.Trainer(accelerator='cpu', overfit_batches=2, max_epochs=30) trainer.fit(model, data_module) final_loss = model.loss_history[-1] assert final_loss < 0.35, \ diff --git a/setup.cfg b/setup.cfg index bbfd61ad0..22aaea135 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,14 +17,13 @@ classifiers = # Indicate who your project is intended for Intended Audience :: Developers Topic :: Scientific/Engineering :: Artificial Intelligence - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.11 [options] packages = find_namespace: zip_safe = True include_package_data = True -python_requires = >=3.8,<4 +python_requires = >=3.11.0,<3.12 install_requires = numpy pillow @@ -35,7 +34,6 @@ install_requires = paho-mqtt simple_pid progress - typing_extensions pyfiglet psutil pynmea2 @@ -51,7 +49,7 @@ pi = adafruit-circuitpython-ssd1306 adafruit-circuitpython-rplidar RPi.GPIO - tensorflow-aarch64==2.9.3 + tensorflow-aarch64==2.15.* opencv-contrib-python nano = @@ -59,24 +57,24 @@ nano = adafruit-circuitpython-ssd1306 adafruit-circuitpython-rplidar Jetson.GPIO - numpy==1.23 - matplotlib==3.7 - kivy==2.1 + numpy==1.23.* + matplotlib==3.7.* + kivy plotly - pandas==2.0 + pandas==2.0.* pc = - tensorflow==2.9 + tensorflow==2.15.* matplotlib - kivy==2.1 + kivy pandas plotly albumentations macos = - tensorflow-macos==2.9 + tensorflow-macos==2.15.* matplotlib - kivy==2.1 + kivy pandas plotly albumentations @@ -88,8 +86,9 @@ dev = mypy torch = - pytorch - torchvision==0.12 + torch + pytorch-lightning + torchvision torchaudio fastai