首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GitHub教程上Google Cloud Healthcare API的ExportDicomData请求始终未完成

GitHub教程上Google Cloud Healthcare API的ExportDicomData请求始终未完成
EN

Stack Overflow用户
提问于 2019-08-19 06:27:22
回答 2查看 141关注 0票数 0

我正在尝试云医疗应用编程接口GitHub教程上的ML Codelabs的AutoML愿景。https://github.com/GoogleCloudPlatform/healthcare/blob/master/imaging/ml_codelab/breast_density_auto_ml.ipynb

我运行了Convert DICOM to JPEG部分的Export DICOM data cell代码,请求以及所有的前提单元代码都成功了。

但是等待操作完成会超时并且永远不会结束。(数据集页面上的ExportDicomData请求状态全天保持“运行”。我做了很多次,但所有的请求都堆积在一起,一直在“运行”。有几次我尝试从头开始做,结果都是一样的。)

到目前为止,我做到了:

1)删除output_config,因为出现无效参数错误。https://github.com/GoogleCloudPlatform/healthcare/issues/133

2)开启云资源管理器API,因为您需要它。

这是手机号码。

代码语言:javascript
复制
# Path to export DICOM data.
dicom_store_url = os.path.join(HEALTHCARE_API_URL, 'projects', project_id, 'locations', location, 'datasets', dataset_id, 'dicomStores', dicom_store_id)
path = dicom_store_url + ":export"

# Headers (send request in JSON format).
headers = {'Content-Type': 'application/json'}

# Body (encoded in JSON format).
# output_config = {'output_config': {'gcs_destination': {'uri_prefix': jpeg_folder, 'mime_type': 'image/jpeg; transfer-syntax=1.2.840.10008.1.2.4.50'}}}
output_config = {'gcs_destination': {'uri_prefix': jpeg_folder, 'mime_type': 'image/jpeg; transfer-syntax=1.2.840.10008.1.2.4.50'}}
body = json.dumps(output_config)

resp, content = http.request(path, method='POST', headers=headers, body=body)
assert resp.status == 200, 'error exporting to JPEG, code: {0}, response: {1}'.format(resp.status, content)
print('Full response:\n{0}'.format(content))

# Record operation_name so we can poll for it later.
response = json.loads(content)
operation_name = response['name']

这是等待的结果。

代码语言:javascript
复制
Waiting for operation completion...
Full response:
{
  "name": "projects/my-datalab-tutorials/locations/us-central1/datasets/sample-dataset/operations/18300485449992372225",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.healthcare.v1beta1.OperationMetadata",
    "apiMethodName": "google.cloud.healthcare.v1beta1.dicom.DicomService.ExportDicomData",
    "createTime": "2019-08-18T10:37:49.809136Z"
  }
}


AssertionErrorTraceback (most recent call last)
<ipython-input-18-1a57fd38ea96> in <module>()
     21 timeout = time.time() + 10*60 # Wait up to 10 minutes.
     22 path = os.path.join(HEALTHCARE_API_URL, operation_name)
---> 23 _ = wait_for_operation_completion(path, timeout)

<ipython-input-18-1a57fd38ea96> in wait_for_operation_completion(path, timeout)
     15 
     16   print('Full response:\n{0}'.format(content))
---> 17   assert success, "operation did not complete successfully in time limit"
     18   print('Success!')
     19   return response

AssertionError: operation did not complete successfully in time limit

接口版本为v1beta1。

我想知道是否有人有什么建议。

谢谢。

EN

回答 2

Stack Overflow用户

发布于 2019-08-20 20:58:58

经过几次不断的尝试和一夜的坚持,它终于成功了。我也不知道原因。

票数 0
EN

Stack Overflow用户

发布于 2020-02-05 03:43:16

codelabs最近有一次更新。错误消息是由codelab中的超时引起的,而不是由于实际操作。这个问题已经在更新中得到了解决。如果您仍然遇到任何问题,请让我知道!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57548794

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档