aws / amazon-sagemaker-examples

Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
https://sagemaker-examples.readthedocs.io
Apache License 2.0
10.04k stars 6.75k forks source link

BYO MME example notebook failing due to MXNet retirement #4562

Open brianloyal opened 7 months ago

brianloyal commented 7 months ago

Link to the notebook https://github.com/aws/amazon-sagemaker-examples/blob/main/advanced_functionality/multi_model_bring_your_own/multi_model_endpoint_bring_your_own.ipynb

Describe the bug Running the first code cell in the "Upload model artifacts to S3" section produces an error that reads, "AssertionError: failed to open http://data.mxnet.io/models/imagenet/resnet/18-layers/resnet-18-0000.params". Browsing to https://mxnet.apache.org, I see that the project was retired in September 2023.

To reproduce Run the notebook in a SageMaker Notebook Instance

Logs

AssertionError Traceback (most recent call last) Cell In[7], line 7 3 import tarfile 5 model_path = "http://data.mxnet.io/models/imagenet/" ----> 7 mx.test_utils.download( 8 model_path + "resnet/18-layers/resnet-18-0000.params", None, "data/resnet_18" 9 ) 10 mx.test_utils.download( 11 model_path + "resnet/18-layers/resnet-18-symbol.json", None, "data/resnet_18" 12 ) 13 mx.test_utils.download(model_path + "synset.txt", None, "data/resnet_18")

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/mxnet/test_utils.py:1812, in download(url, fname, dirname, overwrite, retries) 1810 retries -= 1 1811 if retries <= 0: -> 1812 raise e 1814 print("download failed, retrying, {} attempt{} left" 1815 .format(retries, 's' if retries > 1 else '')) 1816 logging.info("downloaded %s into %s successfully", url, fname)

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/mxnet/test_utils.py:1803, in download(url, fname, dirname, overwrite, retries) 1801 try: 1802 r = requests.get(url, stream=True) -> 1803 assert r.status_code == 200, "failed to open %s" % url 1804 with open(fname, 'wb') as f: 1805 for chunk in r.iter_content(chunk_size=1024):

AssertionError: failed to open http://data.mxnet.io/models/imagenet/resnet/18-layers/resnet-18-0000.params