Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.77k stars 668 forks source link

test error ./modules/tcia_csv_processing.ipynb #802

Closed wyli closed 2 years ago

wyli commented 2 years ago

Describe the bug looks like an issue from the server side

01:08:28  Running ./modules/tcia_csv_processing.ipynb
01:08:28  Checking PEP8 compliance...
01:08:29  Running notebook...
01:08:33  MONAI version: 0.9.1rc3+3.gec4c0311
01:08:33  Numpy version: 1.22.4
01:08:33  Pytorch version: 1.10.2+cu102
01:08:33  MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
01:08:33  MONAI rev id: ec4c03115ba45b2e950103a24db22f16d54c8d40
01:08:33  MONAI __file__: /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/__init__.py
01:08:33  
01:08:33  Optional dependencies:
01:08:33  Pytorch Ignite version: 0.4.9
01:08:33  Nibabel version: 4.0.1
01:08:33  scikit-image version: 0.19.3
01:08:33  Pillow version: 9.0.1
01:08:33  Tensorboard version: 2.9.1
01:08:33  gdown version: 4.5.1
01:08:33  TorchVision version: 0.11.3+cu102
01:08:33  tqdm version: 4.64.0
01:08:33  lmdb version: 1.3.0
01:08:33  psutil version: 5.9.1
01:08:33  pandas version: 1.1.5
01:08:33  einops version: 0.4.1
01:08:33  transformers version: 4.20.1
01:08:33  mlflow version: 1.27.0
01:08:33  pynrrd version: 0.4.3
01:08:33  
01:08:33  For details about installing the optional dependencies, please visit:
01:08:33      https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
01:08:33  
01:08:33  /opt/conda/lib/python3.8/site-packages/papermill/iorw.py:58: FutureWarning: pyarrow.HadoopFileSystem is deprecated as of 2.0.0, please use pyarrow.fs.HadoopFileSystem instead.
01:08:33    from pyarrow import HadoopFileSystem
01:08:45  
Executing:   0%|          | 0/18 [00:00<?, ?cell/s]
Executing:   6%|▌         | 1/18 [00:01<00:26,  1.55s/cell]
Executing:  17%|█▋        | 3/18 [00:06<00:32,  2.17s/cell]
Executing:  28%|██▊       | 5/18 [00:08<00:21,  1.64s/cell]
Executing:  61%|██████    | 11/18 [00:09<00:03,  1.75cell/s]
Executing:  78%|███████▊  | 14/18 [00:10<00:02,  1.84cell/s]
Executing:  78%|███████▊  | 14/18 [00:11<00:03,  1.22cell/s]
01:08:45  Traceback (most recent call last):
01:08:45    File "/opt/conda/bin/papermill", line 8, in <module>
01:08:45      sys.exit(papermill())
01:08:45    File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
01:08:45      return self.main(*args, **kwargs)
01:08:45    File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1053, in main
01:08:45      rv = self.invoke(ctx)
01:08:45    File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
01:08:45      return ctx.invoke(self.callback, **ctx.params)
01:08:45    File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 754, in invoke
01:08:45      return __callback(*args, **kwargs)
01:08:45    File "/opt/conda/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
01:08:45      return f(get_current_context(), *args, **kwargs)
01:08:45    File "/opt/conda/lib/python3.8/site-packages/papermill/cli.py", line 250, in papermill
01:08:45      execute_notebook(
01:08:45    File "/opt/conda/lib/python3.8/site-packages/papermill/execute.py", line 122, in execute_notebook
01:08:45      raise_for_execution_errors(nb, output_path)
01:08:45    File "/opt/conda/lib/python3.8/site-packages/papermill/execute.py", line 234, in raise_for_execution_errors
01:08:45      raise error
01:08:45  papermill.exceptions.PapermillExecutionError: 
01:08:45  ---------------------------------------------------------------------------
01:08:45  Exception encountered at "In [7]":
01:08:45  ---------------------------------------------------------------------------
01:08:45  HTTPError                                 Traceback (most recent call last)
01:08:45  Input In [7], in <cell line: 1>()
01:08:45  ----> 1 data = dataset[0]
01:08:45        2 print(f"Series UID is: {data['Series UID']}")
01:08:45  
01:08:45  Input In [4], in TCIADataset.__getitem__(self, index)
01:08:45       75 if isinstance(index, int):
01:08:45       76     series_uid = self.data[index]["Series UID"]
01:08:45  ---> 77     self.data[index]["image"] = self._get_image(series_uid)
01:08:45       78 return super().__getitem__(index=index)
01:08:45  
01:08:45  Input In [4], in TCIADataset._get_image(self, series_uid)
01:08:45       69 url = "https://services.cancerimagingarchive.net/nbia-api/services/v1/getImage?SeriesInstanceUID=" + series_uid
01:08:45       70 if not os.path.exists(data_dir):
01:08:45  ---> 71     download_and_extract(url=url, filepath=data_dir + ".zip", output_dir=data_dir)
01:08:45       72 return data_dir
01:08:45  
01:08:45  File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/apps/utils.py:312, in download_and_extract(url, filepath, output_dir, hash_val, hash_type, file_type, has_base, progress)
01:08:45      310 with tempfile.TemporaryDirectory() as tmp_dir:
01:08:45      311     filename = filepath or Path(tmp_dir, _basename(url)).resolve()
01:08:45  --> 312     download_url(url=url, filepath=filename, hash_val=hash_val, hash_type=hash_type, progress=progress)
01:08:45      313     extractall(filepath=filename, output_dir=output_dir, file_type=file_type, has_base=has_base)
01:08:45  
01:08:45  File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/apps/utils.py:203, in download_url(url, filepath, hash_val, hash_type, progress, **gdown_kwargs)
01:08:45      201     gdown.download(url, f"{tmp_name}", quiet=not progress, **gdown_kwargs)
01:08:45      202 else:
01:08:45  --> 203     _download_with_progress(url, tmp_name, progress=progress)
01:08:45      204 if not tmp_name.exists():
01:08:45      205     raise RuntimeError(
01:08:45      206         f"Download of file from {url} to {filepath} failed due to network issue or denied permission."
01:08:45      207     )
01:08:45  
01:08:45  File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/apps/utils.py:114, in _download_with_progress(url, filepath, progress)
01:08:45      112 except (URLError, HTTPError, ContentTooShortError, OSError) as e:
01:08:45      113     logger.error(f"Download failed from {url} to {filepath}.")
01:08:45  --> 114     raise e
01:08:45  
01:08:45  File /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/apps/utils.py:107, in _download_with_progress(url, filepath, progress)
01:08:45      104             self.update(b * bsize - self.n)  # will also set self.n = b * bsize
01:08:45      106     with TqdmUpTo(unit="B", unit_scale=True, unit_divisor=1024, miniters=1, desc=_basename(filepath)) as t:
01:08:45  --> 107         urlretrieve(url, filepath, reporthook=t.update_to)
01:08:45      108 else:
01:08:45      109     if not has_tqdm and progress:
01:08:45  
01:08:45  File /opt/conda/lib/python3.8/urllib/request.py:247, in urlretrieve(url, filename, reporthook, data)
01:08:45      230 """
01:08:45      231 Retrieve a URL into a temporary location on disk.
01:08:45      232 
01:08:45     (...)
01:08:45      243 data file as well as the resulting HTTPMessage object.
01:08:45      244 """
01:08:45      245 url_type, path = _splittype(url)
01:08:45  --> 247 with contextlib.closing(urlopen(url, data)) as fp:
01:08:45      248     headers = fp.info()
01:08:45      250     # Just return the local path and the "headers" for file://
01:08:45      251     # URLs. No sense in performing a copy unless requested.
01:08:45  
01:08:45  File /opt/conda/lib/python3.8/urllib/request.py:222, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
01:08:45      220 else:
01:08:45      221     opener = _opener
01:08:45  --> 222 return opener.open(url, data, timeout)
01:08:45  
01:08:45  File /opt/conda/lib/python3.8/urllib/request.py:531, in OpenerDirector.open(self, fullurl, data, timeout)
01:08:45      529 for processor in self.process_response.get(protocol, []):
01:08:45      530     meth = getattr(processor, meth_name)
01:08:45  --> 531     response = meth(req, response)
01:08:45      533 return response
01:08:45  
01:08:45  File /opt/conda/lib/python3.8/urllib/request.py:640, in HTTPErrorProcessor.http_response(self, request, response)
01:08:45      637 # According to RFC 2616, "2xx" code indicates that the client's
01:08:45      638 # request was successfully received, understood, and accepted.
01:08:45      639 if not (200 <= code < 300):
01:08:45  --> 640     response = self.parent.error(
01:08:45      641         'http', request, response, code, msg, hdrs)
01:08:45      643 return response
01:08:45  
01:08:45  File /opt/conda/lib/python3.8/urllib/request.py:569, in OpenerDirector.error(self, proto, *args)
01:08:45      567 if http_err:
01:08:45      568     args = (dict, 'default', 'http_error_default') + orig_args
01:08:45  --> 569     return self._call_chain(*args)
01:08:45  
01:08:45  File /opt/conda/lib/python3.8/urllib/request.py:502, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
01:08:45      500 for handler in handlers:
01:08:45      501     func = getattr(handler, meth_name)
01:08:45  --> 502     result = func(*args)
01:08:45      503     if result is not None:
01:08:45      504         return result
01:08:45  
01:08:45  File /opt/conda/lib/python3.8/urllib/request.py:649, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs)
01:08:45      648 def http_error_default(self, req, fp, code, msg, hdrs):
01:08:45  --> 649     raise HTTPError(req.full_url, code, msg, hdrs, fp)
01:08:45  
01:08:45  HTTPError: HTTP Error 502: Bad Gateway
wyli commented 2 years ago

service is back