简体   繁体   English

无法从站点包导入模块

[英]unable to import module from site-package

i am importing a module from sitepackages but showing error. 我从sitepackages导入模块,但显示错误。 i am successfully able to import a file eg. 我可以成功导入文件,例如。

from tensorflow.contrib.rnn.python.ops import rnn_cell

but when i am going to import a module from rnn_cell by 但是当我要从rnn_cell导入模块时

from tensorflow.contrib.rnn.python.ops.rnn_cell import _norm

i am getting error 我遇到错误

ImportError: cannot import name _norm

PS the module _norm() is present there in rnn_cell file. PS模块_norm()存在于rnn_cell文件中。

I'm not sure this method call has meaning, but anyway, first instantiate the LayerNormBasicLSTMCell class, then call its (internal) method _norm . 我不确定此方法调用是否有意义,但是无论如何,首先实例化LayerNormBasicLSTMCell类,然后调用其(内部)方法_norm

from tensorflow.contrib.rnn.python.ops.rnn_cell import LayerNormBasicLSTMCell

_norm = LayerNormBasicLSTMCell(10)._norm
print(_norm)

Again, this method is for internal use, and is not for outside use. 同样,此方法仅供内部使用,不能供外部使用。 So, I don't think this _norm shortcut has meaning. 因此,我认为此_norm快捷方式没有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM