autorope / donkeycar

Open source hardware and software platform to build a small scale self driving car.
http://www.donkeycar.com
MIT License
3.05k stars 1.28k forks source link

Release 5.0 and installation with pip #1153

Closed DocGarbanzo closed 6 months ago

DocGarbanzo commented 6 months ago

Release 5.0 and installation with pip

This PR is in preparation for the Donkey Car 5.0 release. Compared to current HEAD, this release has the following major changes:

As part of the 5.X release we will also be updating the documentation accordingly. The changes for the documentation are in https://github.com/autorope/donkeydocs/tree/install_with_pip.

cfox570 commented 6 months ago

I have reviewed the changes included for Release 5.0 and would like to encourage you to include changes to the MacOS setup to leverage the Mac GPU. METAL is the GPU technology that powers hardware-accelerated graphics and AI on Apple platforms. METAL is supported by Mac computers from the year 2012. See METAL on Mac Computers. Apple has released tensorflow-macos and tensorflow-metal to speedup tensorflow on the Mac. I have used this installation on both an INTEL and ARM mac for the last couple of years. Here is a set of instructions I have used for installation on the Macbook Air M1. Install Tensorflow-macos. There is one difference for the ARM Mac. For mac computers prior to 2012, the setup would use standard tensorflow. Once you merge the files into the MAIN branch I will work through suggested changes to the code and instructions for each type of Mac. Maybe you could solicit others with Macs to test.

DocGarbanzo commented 6 months ago

I have reviewed the changes included for Release 5.0 and would like to encourage you to include changes to the MacOS setup to leverage the Mac GPU. METAL is the GPU technology that powers hardware-accelerated graphics and AI on Apple platforms. METAL is supported by Mac computers from the year 2012. See METAL on Mac Computers. Apple has released tensorflow-macos and tensorflow-metal to speedup tensorflow on the Mac. I have used this installation on both an INTEL and ARM mac for the last couple of years. Here is a set of instructions I have used for installation on the Macbook Air M1. Install Tensorflow-macos. There is one difference for the ARM Mac. For mac computers prior to 2012, the setup would use standard tensorflow. Once you merge the files into the MAIN branch I will work through suggested changes to the code and instructions for each type of Mac. Maybe you could solicit others with Macs to test.

@cfox570 - this is a very good comment. Having a quick look at your gist above, it looks like we should simply replace tensorflow-macos==2.9 with tensorflow-metal==0.5 in the setup.cfg for the macos target (matching version from here: https://pypi.org/project/tensorflow-metal/). Let's get this merged and then we can do a 5.1 release with the tensorflow metal upgrade thereafter.

cfox570 commented 6 months ago

this is a very good comment. Having a quick look at your gist above, it looks like we should simply replace tensorflow-macos==2.9 with tensorflow-metal==0.5 in the setup.cfg for the macos target (matching version from here: https://pypi.org/project/tensorflow-metal/). Let's get this merged and then we can do a 5.1 release with the tensorflow metal upgrade thereafter.

For Conda, the ARM Mac (M1/M2/M3) needs tensorflow-deps installed via conda not pip. Not sure how you change your setup to accomplish.

DocGarbanzo commented 6 months ago

this is a very good comment. Having a quick look at your gist above, it looks like we should simply replace tensorflow-macos==2.9 with tensorflow-metal==0.5 in the setup.cfg for the macos target (matching version from here: https://pypi.org/project/tensorflow-metal/). Let's get this merged and then we can do a 5.1 release with the tensorflow metal upgrade thereafter.

For Conda, the ARM Mac (M1/M2/M3) needs tensorflow-deps installed via conda not pip. Not sure how you change your setup to accomplish.

This is already part of this PR. Everything now gets installed via pip. Going from tensorflow-macos to tensorflow-metal is a one line change in setup.cfg.

cfox570 commented 6 months ago

To clarify, both tensorflow-macos and tensorflow-metal are required.

cfox570 commented 6 months ago

I tried out the installation of [torch]. I found two issues:

  1. replace PyTorch with just torch
  2. pytorch-lightning is missing

Also I suggest you update the mac instructions to install [macos] instead of [pc]

DocGarbanzo commented 6 months ago

I tried out the installation of [torch]. I found two issues:

1. replace PyTorch with just torch

2. pytorch-lightning is missing

Also I suggest you update the mac instructions to install [macos] instead of [pc]

Thanks @cfox570 - we have tested on Mac Intel with the standard TF install that is in the [pc] configuration and everything works fine with that. I'll give it a try to with the [macos] target and see if this works and makes a difference, but this is independent of the code release here.