aws / aws/amazon-sagemaker-examples
[Bug Report] ImportError: IProgress not found. Please update jupyter and ipywidgets
- Dominant language
- Jupyter Notebook
- Stars
- 11k
- Forks
- 7k
- Avg merge
- 8h 29m
- Merged PRs (30d)
- 8
Description
**Link to the notebook**
https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker_neo_compilation_jobs/deploy_huggingface_model_on_Inf1_instance/inf1_bert_compile_and_deploy.ipynb
**Describe the bug**
Running the cell to get model from HuggingFace Model Hub in SageMaker Studio result in `ImportError: IProgress not found. Please update jupyter and ipywidgets`.
**To reproduce**
Run the notebook in SageMaker Studio.
**Logs**
```
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in
----> 1 tokenizer = transformers.AutoTokenizer.from_pretrained("distilbert-base-uncased")
2
3 model = transformers.AutoModelForSequenceClassification.from_pretrained(
4 "distilbert-base-uncased", return_dict=False
5 )
/opt/conda/lib/python3.6/site-packages/transformers/models/auto/tokenization_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
461
462 # Next, let's try to use the tokenizer_config file to get the tokenizer class.
--> 463 tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
464 config_tokenizer_class = tokenizer_config.get("tokenizer_class")
465 tokenizer_auto_map = tokenizer_config.get("auto_map")
/opt/conda/lib/python3.6/site-packages/transformers/models/auto/tokenization_auto.py in get_tokenizer_config(pretrained_model_name_or_path, cache_dir, force_download, resume_download, proxies, use_auth_token, revision, local_files_only, **kwargs)
331 use_auth_token=use_auth_token,
332 revision=revision,
--> 333 local_files_only=local_files_only,
334 )
335 if resolved_config_file is None:
/opt/conda/lib/python3.6/site-packages/transformers/file_utils.py in get_file_from_repo(path_or_repo, filename, cache_dir, force_download, resume_download, proxies, use_auth_token, revision, local_files_only)
2240 resume_download=resume_download,
2241 local_files_only=local_files_only,
-> 2242 use_auth_token=use_auth_token,
2243 )
2244
/opt/conda/lib/python3.6/site-packages/transformers/file_utils.py in cached_path(url_or_filename, cache_dir, force_download, proxies, resume_download, user_agent, extract_compressed_file, force_extract, use_auth_token, local_files_only)
1852 user_agent=user_agent,
1853 use_auth_token=use_auth_token,
-> 1854 local_files_only=local_files_only,
1855 )
1856 elif os.path.exists(url_or_filename):
/opt/conda/lib/python3.6/site-packages/transformers/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, use_auth_token, local_files_only)
2140 logger.info(f"{url} not found in cache or force_download set to True, downloading to {temp_file.name}")
2141
-> 2142 http_get(url_to_download, temp_file, proxies=proxies, resume_size=resume_size, headers=headers)
2143
2144 logger.info(f"storing {url} in cache at {cache_path}")
/opt/conda/lib/python3.6/site-packages/transformers/file_utils.py in http_get(url, temp_file, proxies, resume_size, headers)
1997 total=total,
1998 initial=resume_size,
-> 1999 desc="Downloading",
2000 )
2001 for chunk in r.iter_content(chunk_size=1024):
/opt/conda/lib/python3.6/site-packages/transformers/utils/logging.py in __call__(self, *args, **kwargs)
310 def __call__(self, *args, **kwargs):
311 if _tqdm_active:
--> 312 return tqdm_lib.tqdm(*args, **kwargs)
313 else:
314 return EmptyTqdm(*args, **kwargs)
/opt/conda/lib/python3.6/site-packages/tqdm/notebook.py in __init__(self, *args, **kwargs)
222 total = self.total * unit_scale if self.total else self.total
223 self.container = self.status_printer(
--> 224 self.fp, total, self.desc, self.ncols)
225 self.sp = self.display
226 self.colour = colour
/opt/conda/lib/python3.6/site-packages/tqdm/notebook.py in status_printer(_, total, desc, ncols)
95 if IProgress is None: # #187 #451 #558 #872
96 raise ImportError(
---> 97 "IProgress not found. Please update jupyter and ipywidgets."
98 " See https://ipywidgets.readthedocs.io/en/stable"
99 "/user_install.html")
ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
```
Contributor guide
Research direction
Open sagemaker_neo_compilation_jobs/deploy_huggingface_model_on_Inf1_instance/inf1_bert_compile_and_deploy.ipynb and run the cell that loads the tokenizer and model from the Hugging Face Model Hub in SageMaker Studio. Inspect the notebook's Jupyter and ipywidgets setup in light of the logged tqdm IProgress error; done means the cell runs without the ImportError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- huggingface, jupyter, jupyter-notebook, python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100