SageMaker Local Mode will not work on Windows unless you install WSL 2 and then, a Linux distro (Ubuntu is the default).
If you try to run the examples in this repo, you'll eventually get TypeError: object of type 'int' has no len()
error after completing the training job.
The problem is because of failures to output the model on temporary folders created for the training job by SageMaker Local, and are related to Windows directory structure/permissions.
- Install Docker Desktop for Windows.
- Install Linux on Windows with WSL. We assume you install the default Ubuntu distro.
- Once installed, you can search for Ubuntu in your Windows search bar.
- Once Ubuntu has finished its initial setup you will need to create a username and password (this does not need to match your Windows user credentials).
- Finally, it’s always good practice to install the latest updates with the following commands, entering your password when prompted. Execute:
sudo apt update
Press Y when prompted. - Clone this GitHub repository:
git clone https://github.com/aws-samples/amazon-sagemaker-local-mode
- Open Visual Studio Code and install the WSL Extension
- In Visual Studio Code: Choose
File
->Open Folder
and open theamazon-sagemaker-local-mode
folder located on Ubuntu, you just cloned in previous step. - Once you run a sample code, you'll see that the temporary folders created for the training job by SageMaker Local, are now of Linux format, using WSL2. You should see
[WSL:Ubuntu]
in the upper bar of the Visual Studio Code window.