Deploying ML model #2375
Replies: 5 comments
-
Your script is using a dependency that is not installed in the container:
Also the error is coming from |
Beta Was this translation helpful? Give feedback.
-
Hi Nadiaya, thanks for the reply! How do I fix the s3fs error? I’ve tried with pip install and conda install, and the s3fs is both in pip list and conda list. My_script.py is actually Failure_pred.py, I just renamed here for the purpose of this question, but in my code is everywhere Failure_pred.py |
Beta Was this translation helpful? Give feedback.
-
you should be able to add it using requirement.txt file just put in the same direction with the user script file:
|
Beta Was this translation helpful? Give feedback.
-
Uhm I’ve read some documentation about this requirement.txt but I don’t exactly understand how can I write it, is like a .txt file with only b3fs written in it? And the uploaded into the data_DM folder? |
Beta Was this translation helpful? Give feedback.
-
Hi, If you want to use An example of requirements.txt is like this: https://github.com/aws/sagemaker-tensorflow-serving-container/blob/master/test/resources/examples/test3/requirements.txt (you do not have to specify the version of the library) |
Beta Was this translation helpful? Give feedback.
-
Hi, 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:
And here the My_script.py:
Now the error is the following:
/miniconda3/lib/python3.7/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
Traceback (most recent call last):
File "/miniconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/miniconda3/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/opt/ml/code/Failure_Pred.py", line 206, in
"weight", "userPrice", "amount", "nParcel"])
File "/miniconda3/lib/python3.7/site-packages/pandas/io/parsers.py", line 685, in parser_f
return _read(filepath_or_buffer, kwds)
File "/miniconda3/lib/python3.7/site-packages/pandas/io/parsers.py", line 440, in _read
filepath_or_buffer, encoding, compression
File "/miniconda3/lib/python3.7/site-packages/pandas/io/common.py", line 206, in get_filepath_or_buffer
from pandas.io import s3
File "/miniconda3/lib/python3.7/site-packages/pandas/io/s3.py", line 10, in
"s3fs", extra="The s3fs package is required to handle s3 files."
File "/miniconda3/lib/python3.7/site-packages/pandas/compat/_optional.py", line 93, in import_optional_dependency
raise ImportError(message.format(name=name, extra=extra)) from None
ImportError: Missing optional dependency 's3fs'. The s3fs package is required to handle s3 files. Use pip or conda to install s3fs.
2020-07-09 12:13:27,645 sagemaker-containers ERROR ExecuteUserScriptError:
Command "/miniconda3/bin/python -m Failure_Pred"
2020-07-09 12:13:36 Uploading - Uploading generated training model
2020-07-09 12:13:36 Failed - Training job failed
Error for Training job sagemaker-scikit-learn-2020-07-09-12-10-17-446: Failed. Reason: AlgorithmError: ExecuteUserScriptError:
Command "/miniconda3/bin/python -m Failure_Pred"
How can I fix this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions