【问题标题】:Tensorflow couldn't open CUDA library libcupti.so.8.0 during training on google cloud在谷歌云训练期间,Tensorflow 无法打开 CUDA 库 libcupti.so.8.0
【发布时间】:2017-04-02 15:14:50
【问题描述】:

我正在尝试在 Google Cloud 机器学习引擎上使用 Tensorflow 训练模型。由于 LD_LIBRARY_PATH 未指向正确的目录,tensorflow 似乎无法访问云计算机上的 libcupti 文件,如下面的日志条目所示:

lineno: 126    
  message: "Couldn't open CUDA library libcupti.so.8.0.
            LD_LIBRARY_PATH: /usr/local/cuda/lib64"    
levelname: "INFO"    
pathname: "tensorflow/stream_executor/dso_loader.cc"    
created: 1491143889.84344   

据我所知,libcupti 文件都在/usr/local/cuda/extras/CUPTI/lib64 中,所以我需要将它附加到 LD_LIBRARY_PATH 变量中,但是通过gcloud ml-engine jobs submit training $JOB_NAME 命令提交作业时我该怎么做呢?或者也许有更简单的解决方案?

【问题讨论】:

  • 是否会为所有 GPU 训练作业触发此错误?您能否使用 Google Cloud 在 GPU 上运行任何训练作业?
  • 我还没有时间尝试测试另一种类型的工作...不过如果有机会我会尝试的。

标签: tensorflow google-cloud-platform google-cloud-ml-engine


【解决方案1】:

我尝试在谷歌云上使用 GPU 和 tensorflow,它对我有用。在我的代码中,我没有进行任何 GPU 特定设置(也没有使用 LD_LIBRARY_PATH 设置任何内容)

我认为您可以尝试使用简单且标准的 tensorflow 代码,并在提交作业时附加配置,然后该作业应自动使用 GPU 为您进行计算。

尝试在你的模块中添加一个文件,例如cloudml-gpu.yaml,内容如下:

trainingInput:
  scaleTier: CUSTOM
  # standard_gpu provides 1 GPU. Change to complex_model_m_gpu for 4 
GPUs
  masterType: standard_gpu
  runtimeVersion: "1.0"

然后添加一个名为--config=trainer/cloudml-gpu.yaml 的选项(假设您的培训模块位于名为trainer 的文件夹中)。例如:

export BUCKET_NAME=tf-learn-simple-sentiment
export JOB_NAME="example_5_train_$(date +%Y%m%d_%H%M%S)"
export JOB_DIR=gs://$BUCKET_NAME/$JOB_NAME
export REGION=europe-west1

gcloud ml-engine jobs submit training $JOB_NAME \
  --job-dir gs://$BUCKET_NAME/$JOB_NAME \
  --runtime-version 1.0 \
  --module-name trainer.example5-keras \
  --package-path ./trainer \
  --region $REGION \
  --config=trainer/cloudml-gpu.yaml \
  -- \
  --train-file gs://tf-learn-simple-sentiment/sentiment_set.pickle

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-02
    • 2017-04-21
    相关资源
    最近更新 更多