没有名为 helpers 的模块

you*_*you 5 python tensorflow

当我运行本教程时, 我尝试导入助手 。但是,这报错:ImportError: No module named helpers。我在 pypi 中找不到任何合适的包。如何获取第三方包?

以下是教程片段

In [1]:
x = [[5, 7, 8], [6, 3], [3], [1]]
While manipulating such variable-length lists are convenient to humans, RNNs prefer a different layout:
In [2]:
import helpers
xt, xlen = helpers.batch(x)
In [3]:
x
Out[3]:
[[5, 7, 8], [6, 3], [3], [1]]
In [4]:
xt
Out[4]:
array([[5, 6, 3, 1],
       [7, 3, 0, 0],
       [8, 0, 0, 0]], dtype=int32)
Run Code Online (Sandbox Code Playgroud)

代码如下

注意:帮手不是帮手

abc*_*ccd 6

您正在寻找的模块helpers是由您链接的教程的创建者创建的。

(它不是 TensorFlow 包之一),您可以通过克隆整个 GitHub存储库或仅下载helpers.py.