【问题标题】:Fix no module 'layer' in current Google Colab TF version修复当前 Google Colab TF 版本中没有模块“层”
【发布时间】:2018-10-30 22:49:02
【问题描述】:

我使用谷歌 colab (python3 GPU)

例如,我想运行this repo codes,但在这些行中运行演示 ipynb 时出现错误:

import tensorflow as tf
from layers import (_causal_linear, _output_linear, conv1d, dilated_conv1d) 

当我运行这两行时,我有一个错误“没有模块层”

我不认为这是一个错误或什么,因为这个 repo 有超过 1000 颗星。 我认为这是一个 tf 版本的问题。

有什么办法解决这个问题吗?

【问题讨论】:

  • 该库需要什么版本的 TensorFlow? Colab 始终使用 TensorFlow 的最新稳定版本(当前为 1.12),因此库可能需要更新以支持最新版本的 TensorFlow。

标签: tensorflow google-colaboratory


【解决方案1】:

“Layers”是您在 Tensorflow 中未链接的包中的一个模块。见here

顺便说一句,如果你想从张量流的子模块导入,你必须这样做from tensorflow.package import ...

【讨论】:

    猜你喜欢
    • 2022-11-23
    • 2016-01-24
    • 1970-01-01
    • 2019-10-27
    • 2022-01-06
    • 2019-08-07
    • 1970-01-01
    • 2019-12-27
    • 1970-01-01
    相关资源
    最近更新 更多