I have python script.py, which is a KNN machine learning algorithm writer from scratch.
Just using pandas and numpy libraries.
Script contains all the functions.
It takes some arguments such as train_data, test_data, k_val etc. And I want to run this in the sagemaker.
Looking for a solution how I can put this script in docker image and invoke it in sagemaker from ECR container.
How to run python script (which has some functions written in it) in sagemaker?
1.4k views Asked by Harsh Patel At
1
There are 1 answers
Related Questions in PYTHON
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in DOCKER
- sqlplus myusername/mypassword@ORCL not working with Oracle on Docker
- Golang == Error: OCI runtime create failed: unable to start container process: exec: "./bin": stat ./bin: no such file or directory: unknown
- Only the first SQL script gets executed inside Docker Postgres container
- Retrieve the Dockerfile configuration from the Kubernetes and also change container Java parameter?
- Polars with Rust: Out of Memory Error when Processing Large Dataset in Docker Using Streaming
- Compiling eBPF program in Docker fails due to missing '__u64' type
- AttributeError: module 'numba' has no attribute 'generated_jit'
- Phoenix in a docker dev environment - generated code can't be saved from VSCode
- Docker on Multipass VMs: Connecting worker nodes to swarm results in rcp error
- Facing error in creating image of my react+vite project . Dockerfile error
- NextJS Docker build fails: fetch failed ECONNREFUSED
- Docker container unable to make HTTPS requests to external API
- Failed to connect to your instance after deploying mern app on aws ec2 instance when i try to access frontend
- Connecting to Postgres running in a Docker container using psql
- Can't connect to local postgresql server from my docker container
Related Questions in MACHINE-LEARNING
- Trained ML model with the camera module is not giving predictions
- Keras similarity calculation. Enumerating distance between two tensors, which indicates as lists
- How to get content of BLOCK types LAYOUT_TITLE, LAYOUT_SECTION_HEADER and LAYOUT_xx in Textract
- How to predict input parameters from target parameter in a machine learning model?
- The training accuracy and the validation accuracy curves are almost parallel to each other. Is the model overfitting?
- ImportError: cannot import name 'HuggingFaceInferenceAPI' from 'llama_index.llms' (unknown location)
- Which library can replace causal_conv1d in machine learning programming?
- Fine-Tuning Large Language Model on PDFs containing Text and Images
- Sketch Guided Text to Image Generation
- My ICNN doesn't seem to work for any n_hidden
- Optuna Hyperband Algorithm Not Following Expected Model Training Scheme
- How can I resolve this error and work smoothly in deep learning?
- ModuleNotFoundError: No module named 'llama_index.node_parser'
- Difference between model.evaluate and metrics.accuracy_score
- Give Bert an input and ask him to predict. In this input, can Bert apply the first word prediction result to all subsequent predictions?
Related Questions in KNN
- How does Elasticsearch do attribute filtering during knn (vector-based) retrieval?
- How to use query combined to KNN with ElasticSearch?
- The KNN model I am using is always coming back at 100% accuracy but it shouldn't be
- identify objects with 2 classes using knn and greyscale and display the appearance in the GUI
- KNN algorithm from OCR project having trouble with certain digits
- SOLR compatibility of the KNN query parser with function queries
- How to decrease too many False Positives I get from a KNN classifier for ECG R-peak detection?
- Inconsistent results when using KNN innerproduct scoring on OpenSearch depending on if a filter is set
- Python: Missing (Constant) Inaccuracy from knn_classifier() on eeg audio (X_train)
- Prediction Accuracy Zero (y_pred == y_test) & ValueError after Binary Projection, kNN Hamming, Xtrain/y_train appear accurate
- How to combine a column containing score value with knn score of rest of the columns
- R package 'BiocNeighbors' resturn different nearest neighbors with other packages (e.g., FNN package)
- Regression And Classification
- KNN Across categories in postgis using indexing
- knn manual calculation vs. R class package
Related Questions in AMAZON-ECR
- AWS CLI - Create Lambda With Public ECR Url Keeps Erroring
- Azure Devops ecr login
- Encountering 'denied: Not Authorized' error while pushing Docker image to AWS ECR Public registry
- appending variable to image artefacts
- deleting all old ecr images for a particular branch
- tensorflow and libcudart library issue in AWS sagemaker endpoint creation
- AWS: Setting up a CodeDeploy pipeline for ECS blue-green deployment from ECR
- Configuring secret for ECR pull through cache for dockerhub or github cr docs don't specify the valid key names
- AWS Batch, Real Time rendering - decrease tasks' "Pending" time
- Yolov7 docker image size exceeding 6GB /issue
- Can I some how make 2nd task run automatically after completion of first task in aws fargate
- I need to use image to create docker or pull it from AWS ECR to be used in GitHub workflow action container to be the runner of steps on this job
- Not able to login into Docker through AWS CLI
- ACR Tags are overwriting
- When NPM START needs write permission?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
What you need is called SageMaker BYOC (Bring Your Own Container).
SageMaker has pre-built containers for most of the ML algorithms, however for custom algorithms and custom code it provides support for creating custom containers.
They are basically of 2 types: If your goal is to train a model, run validation & save the model file.
-Training ContainerIf your goal is to use an existing model for inference, with SageMaker Endpoint Hosting or Batch Transform.
-Serving ContainerRefer to this repository for detailed steps. The files
predictor.py&serveare the most important, which contain your custom code.References: Link1 Link2