Tensorflow正在对原始文件创建错误

时间:2019-08-08 15:08:29

标签: linux python-3.x tensorflow

背景

目的是开发一种涉及张量流的机器学习算法。

问题

导入tensorflow会导致错误:“文件“ tensorboard / compat / proto / resource_handle.proto”的无效原型描述符”(请参阅​​我的代码结尾处的错误日志。)

已采取的操作

尝试运行pip卸载protobuf。接下来,pip install --no-binary protobuf protobuf。 但是,这会导致第二个错误,即“没有Google protobuf。如果我安装protobuf,则会再次遇到第一个错误。

平台

Ubuntu 18.10,适用于GPU的v 64位。 Python 3.6.8。

我的代码

import tensorflow-nightly-gpu #(regardless of version of tf I get the error)

import pandas as pd

...

错误日志

Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file 
"tensorboard/compat/proto/resource_handle.proto":
  tensorboard.ResourceHandleProto.device: "tensorboard.ResourceHandleProto.device" is already defined in file "tensorboard/src/resource_handle.proto".
  tensorboard.ResourceHandleProto.container: "tensorboard.ResourceHandleProto.container" is already defined in file "tensorboard/src/resource_handle.proto".
  tensorboard.ResourceHandleProto.name: "tensorboard.ResourceHandleProto.name" is already defined in file "tensorboard/src/resource_handle.proto".
  tensorboard.ResourceHandleProto.hash_code: "tensorboard.ResourceHandleProto.hash_code" is already defined in file "tensorboard/src/resource_handle.proto".
  tensorboard.ResourceHandleProto.maybe_type_name: "tensorboard.ResourceHandleProto.maybe_type_name" is already defined in file "tensorboard/src/resource_handle.proto".

1 个答案:

答案 0 :(得分:0)

通过以下步骤解决了我自己的问题:

1。删除所有现有的GPU,CUDA,CUDNN驱动程序并从我的计算机中删除所有张量流

  1. https://www.tensorflow.org/install/gpu

  2. 中的说明安装适用于GPU,CUDA,CUDNN的驱动程序
  3. 从此处安装tensorflow,phttps://www.tensorflow.org/install/pip