sagemaker-containers | Please use the SageMaker Training Toolkit | Machine Learning library

 by   aws Python Version: 2.8.6.post2 License: Apache-2.0

kandi X-RAY | sagemaker-containers Summary

kandi X-RAY | sagemaker-containers Summary

sagemaker-containers is a Python library typically used in Artificial Intelligence, Machine Learning, Deep Learning, Pytorch, Tensorflow, Bert applications. sagemaker-containers has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install sagemaker-containers' or download it from GitHub, PyPI.

WARNING: This package has been deprecated. Please use the SageMaker Training Toolkit for model training and the SageMaker Inference Toolkit for model serving.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              sagemaker-containers has a low active ecosystem.
              It has 157 star(s) with 78 fork(s). There are 22 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 2 open issues and 19 have been closed. On average issues are closed in 24 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of sagemaker-containers is 2.8.6.post2

            kandi-Quality Quality

              sagemaker-containers has 0 bugs and 0 code smells.

            kandi-Security Security

              sagemaker-containers has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              sagemaker-containers code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              sagemaker-containers is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              sagemaker-containers releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              sagemaker-containers saves you 2763 person hours of effort in developing the same functionality from scratch.
              It has 5983 lines of code, 467 functions and 69 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed sagemaker-containers and discovered the below as its top functions. This is intended to give you an instant insight into sagemaker-containers implemented functionality, and help decide if they suit your requirements.
            • Starts S3 synchronization
            • Start GUnicorn
            • Adds a SIGTERM signal handler
            • Create nginx config file
            • Watch inotify
            • Copy a file to S3
            • Generate a timestamp
            • Create the command line for the VM
            • Parse custom MPI options
            • Convert mapping to command line arguments
            • Decode an object as a numpy array
            • Create training directories
            • Read the hyperparameters file
            • Return the arguments that match fn
            • Log a user script invocation
            • Start the MPI process
            • Run the script
            • Encode an array like object as a numpy array
            • Check if training path is configured
            • Convert an object to a numpy array
            • Generate a dictionary of environment variables
            • Convert dict to env vars
            • Download and extract a tar file
            • Download and install a module
            • Reads the configuration file
            • Default transform function
            • Convert a NumPy array to a bytes buffer
            Get all kandi verified functions for this library.

            sagemaker-containers Key Features

            No Key Features are available at this moment for sagemaker-containers.

            sagemaker-containers Examples and Code Snippets

            SageMaker gives CannotStartContainerError although I specified an entrypoint
            Pythondot img1Lines of Code : 2dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            ENTRYPOINT ["python3.7", "/opt/ml/code/train.py"]
            
            How to parse AWS Sagemaker SM_USER_ARGS with argparse into an argparse Namespace?
            Pythondot img2Lines of Code : 141dot img2License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            [Docker]
            home_dir = /opt
            SM_MODEL_DIR = %(home_dir)s/ml/model
            SM_CHANNELS = ["training"]
            SM_NUM_GPUS = 1
            SM_NUM_CPUS =
            SM_LOG_LEVEL = 20
            SM_USER_ARGS = ["--test_size","0.2","--random_seed","42", "--not_optimize"]
            SM_INPUT_DIR = %(home_dir)

            Community Discussions

            QUESTION

            Aws Sagemaker - ModuleNotFoundError: No module named 'cv2'
            Asked 2021-Apr-14 at 14:21

            I am trying to run a object detection code in Aws. Although opencv is listed in the requirement file, i have the error "no module named cv2". I am not sure how to fix this error. could someone help me please.

            My requirement.txt file has

            • opencv-python
            • numpy>=1.18.2
            • scipy>=1.4.1
            • wget>=3.2
            • tensorflow==2.3.1
            • tensorflow-gpu==2.3.1
            • tqdm==4.43.0
            • pandas
            • boto3
            • awscli
            • urllib3
            • mss

            I tried installing "imgaug" and "opencv-python headless" as well.. but still not able to get rid of this error.

            ...

            ANSWER

            Answered 2021-Apr-14 at 14:21

            Make sure your estimator has

            • framework_version = '2.3',
            • py_version = 'py37',

            Source https://stackoverflow.com/questions/67093041

            QUESTION

            SageMaker in local Jupyter notebook: cannot use AWS hosted XGBoost container ("KeyError: 'S3DistributionType'" and "Failed to run: ['docker-compose'")
            Asked 2020-Aug-14 at 01:04

            Running SageMaker within a local Jupyter notebook (using VS Code) works without issue, except that attempting to train an XGBoost model using the AWS hosted container results in errors (container name: 246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-xgboost:1.0-1-cpu-py3).

            Jupyter Notebook ...

            ANSWER

            Answered 2020-Aug-14 at 01:04

            When running SageMaker in a local Jupyter notebook, it expects the Docker container to be running on the local machine as well.

            The key to ensuring that SageMaker (running in a local notebook) uses the AWS hosted docker container, is to omit the LocalSession object when initializing the Estimator.

            Wrong

            Source https://stackoverflow.com/questions/63405080

            QUESTION

            How to plot history of training metrics in Sagemaker .py training
            Asked 2020-Jul-13 at 16:28

            I am running a notebook in Sagemaker and I use a .py file for training:

            ...

            ANSWER

            Answered 2020-Jul-13 at 16:28

            A SageMaker training job in "local" is actually executing inside of a Docker container that is isolated from the Python kernel that is executing your notebook. Therefore, the plt.show() in the train_cnn.py script doesn't actually get routed to the notebook UI in the same way that executing that command directly from a notebook would.

            Instead of using plt.show(), consider using plt.savefig() to output the plot to an image:

            Source https://stackoverflow.com/questions/62856049

            QUESTION

            aws deploying ML model
            Asked 2020-Jul-10 at 09:26

            I've locally implemented an ML model that I need to deploy on S3 and then creating a Lambda in order to invoke it.

            The problem is that I'm facing tons of errors. I've tried to read the documentation and follow some notebooks, but I can't figure how to make my model working out.

            Here is the code:

            ...

            ANSWER

            Answered 2020-Jul-10 at 09:26

            edit 07/10: adding the training key in the local reading path: replacing opt/ml/input/data/orders.csv by opt/ml/input/data/train/orders.csv



            You have an error because your data = pd.read_csv(data_location, ...) tries to read from S3. Try replacing by data = pd.read_csv('opt/ml/input/data/orders.csv', ...)

            If you use SageMaker, you do not need to read from S3 inside your training script: SageMaker does the copy from S3 to EC2 for you.

            Instead, as indicated in the documentation, you only need to read the data from the local path opt/ml/input/data/ where is the key used to name your input in the training call model.fit({'': 's3://my data'}). Note that local here means local to the remote ephemeral SageMaker Training EC2 instance, not to the SageMaker Notebook EC2 instance you may be using for development and orchestration.

            Same thing with the artifact copy to s3: you do not need to do it yourself. Just write the artifact in the local path opt/ml/model, and the service will copy it back to S3. Some AWS-provided containers (like the sklearn container) also provide input data path and artefact path in environment variable(SM_CHANNEL_ and SM_MODEL_DIR), which you can optionally use to avoid hard-coding them in your code. You can get inspiration from this random forest demo and adapt it to your case. You do not need s3fs.

            Source https://stackoverflow.com/questions/62817338

            QUESTION

            How can I get current job-name in SageMaker training job script?
            Asked 2020-Jun-30 at 18:19

            I write some training job on AWS-SageMaker framework.

            For some it's requirements, it needs know the job-name of which current running on.

            I know this code works for it ...

            ...

            ANSWER

            Answered 2020-Jun-30 at 18:19

            For older containers using the deprecated sagemaker_containers, the approach you described is correct.

            For newer containers that use sagemaker-training-toolkit, this is how you retrieve information about the environment: https://github.com/aws/sagemaker-training-toolkit#get-information-about-the-container-environment

            Source https://stackoverflow.com/questions/62462790

            QUESTION

            SageMaker gives CannotStartContainerError although I specified an entrypoint
            Asked 2020-Mar-31 at 16:22

            I want to train a custom ML model with SageMaker. The model is written in Python and should be shipped to SageMaker in a Docker image. Here is a simplified version of my Dockerfile (the model sits in the train.py file):

            ...

            ANSWER

            Answered 2020-Mar-31 at 16:22

            I found a hint in the AWS docs and came up with this solution:

            Source https://stackoverflow.com/questions/60953289

            QUESTION

            How to parse AWS Sagemaker SM_USER_ARGS with argparse into an argparse Namespace?
            Asked 2020-Mar-11 at 22:30

            AWS Sagemaker uses SM_USER_ARGS (as documented here) as an environment variable in which it contains a string (list) of arguments as they are passed by the user. So the environment variable value looks like this: '["--test_size","0.2","--random_seed","42", "--not_optmize"]'.

            With json.loads() I am capable of transforming that string into a python list. Although, I want to create an abstract module that returns an argparse Namespace in a way that rest of the code remains intact whether I run it locally or in the AWS Sagemaker service.

            So, basically, what I want is a code that receives the input ["--test_size","0.2","--random_seed","42", "--not_optmize"] and output Namespace(test_size=0.2, random_seed='42', not_optmize=True, ... ]).

            Does python argparse package helps me with that? I am trying to figure out a way that I do not need to re implement the argparse parser.

            Here is an example, I have this config.ini file:

            ...

            ANSWER

            Answered 2020-Mar-11 at 22:30

            Following @chepner's comment an example solution would be something like this:

            config.ini file:

            Source https://stackoverflow.com/questions/60644771

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install sagemaker-containers

            You can install using 'pip install sagemaker-containers' or download it from GitHub, PyPI.
            You can use sagemaker-containers like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install sagemaker-containers

          • CLONE
          • HTTPS

            https://github.com/aws/sagemaker-containers.git

          • CLI

            gh repo clone aws/sagemaker-containers

          • sshUrl

            git@github.com:aws/sagemaker-containers.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link