Quick Start MLHub
See the Platform Guide for getting started with Ubuntu if you don’t already have a Ubuntu installation. This quick start assumes a fresh install of Ubuntu (20.04) LTS and so some of the steps may not be necessary for a pre-existing installation.
Let’s get started with installing MLHub, after making sure the system is up to date. You may be asked questions to confirm that you would like a variety of packages to be installed. This can take 5 minutes or so.
$ sudo apt update $ sudo apt upgrade $ sudo apt install python3-pip $ pip3 install mlhub $ pip3 install wajig
After this series of commands the ml command should be available. If a WARNING suggests the command is not on PATH or when you type ml at the prompt the command is not found, you may need to log out and back in again to refresh the PATH. On Ubuntu the path will be setup properly on login, once the package is installed. If all else fails, the following command will ensure the pip3 install path is on the PATH for the user, though this should not normally be required:
$ echo 'PATH=~/.local/bin:$PATH' >> ~/.bashrc
Once you have a working ml command (i.e., typing
ml at the command line prompt responds with useful information about mlhub) you can configure the command itself and check what packages are available. The configure will install quite a comprehensive collection of AI technology to have your computer AI-ready. This will include several hundred packages (mostly small) that are downloaded and installed. For each of the major packages you will be asked to confirm that it is okay to install (we recommend you answer yes to each install request). This could take up to 5 minutes.
$ ml configure # Configure the dependencies for mlhub - required only once. $ ml # Show a useful usage message. $ ml available # List of pre-built models from MLHub. $ ml installed # List of pre-built models installed locally.
Once working you will be able to run the Hello World example which is the rain model. This uses the free and open source R statistical software package.
The simple (TL;DR) version is below. Note that you type the command
ml install rain and that everything from the
# to the end of the line is ignored (it’s a comment). The configure command will install any model specific dependencies and could again take a couple of minutes. It is only needed once after the install.
$ ml install rain # Install the pre-built model named 'rain'. $ ml configure rain # Configure any dependencies for the model. $ ml readme rain # View background information about the model. $ ml commands rain # List of commands supported by the model. $ ml demo rain # Run the demonstration of the pre-built model. $ ml predict rain # Interact with the model to predict rain.
If for the demo command you see the message Graphic display is required but not available then be sure you have graphic capabilities enabled. For example, using WSL with XMing you might need to run the command
export DISPLAY=:0 and ensure that XMing is running.
Different pre-built model packages will have different system dependencies and these will be installed by the configure command. Other packages recommended for new-to-AI to explore include objects and animate. More sophisticate users might review azcv and cars.
To uninstall a package and to recover the disk storage used by the package:
$ ml uninstall rain
Visit the Package Catalogue for curated packages ready to explore.
The Survival Guide provides details of using MLHub and of the many and flexible packages available.
The Tips and Tricks page of the Survival Guide is a useful guide to some shortcuts in using MLHub.
To upgrade to the latest version of mlhub:
$ ml --version 3.6.0 $ pip3 install --upgrade mlhub ... $ ml --version 3.7.4
If you are connecting to a remote Ubuntu server over the Internet where you run the mlhub packages, then once your system is setup you can connect to the server using X2Go for a desktop experience, rather than via a terminal, using
$ wajig update $ wajig distupgrade $ wajig install gnome-terminal ubuntu-mate-desktop x2goserver