模块未找到错误:没有名为'tf_slim'的模块



使用 Anaconda 尝试设置 deeplab (https://github.com/tensorflow/models/tree/master/research/deeplab(。

通过看到其他问题的答案,我已经解决了很多问题,但遇到了一个似乎没有得到答案的问题:

当尝试运行"Python deeplab/model_test.py"时,我得到:

(base) PS D:DeepLabmodels-masterresearch> python deeplab/model_test.py
C:UsersJakeanaconda3libsite-packagestensorflowpythonframeworkdtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:UsersJakeanaconda3libsite-packagestensorflowpythonframeworkdtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:UsersJakeanaconda3libsite-packagestensorflowpythonframeworkdtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:UsersJakeanaconda3libsite-packagestensorflowpythonframeworkdtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:UsersJakeanaconda3libsite-packagestensorflowpythonframeworkdtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:UsersJakeanaconda3libsite-packagestensorflowpythonframeworkdtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:UsersJakeanaconda3libsite-packagestensorboardcompattensorflow_stubdtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:UsersJakeanaconda3libsite-packagestensorboardcompattensorflow_stubdtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:UsersJakeanaconda3libsite-packagestensorboardcompattensorflow_stubdtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:UsersJakeanaconda3libsite-packagestensorboardcompattensorflow_stubdtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:UsersJakeanaconda3libsite-packagestensorboardcompattensorflow_stubdtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:UsersJakeanaconda3libsite-packagestensorboardcompattensorflow_stubdtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
File "deeplab/model_test.py", line 22, in <module>
from deeplab import model
File "D:DeepLabmodels-masterresearchdeeplabmodel.py", line 58, in <module>
from deeplab.core import feature_extractor
File "D:DeepLabmodels-masterresearchdeeplabcorefeature_extractor.py", line 24, in <module>
from deeplab.core import nas_network
File "D:DeepLabmodels-masterresearchdeeplabcorenas_network.py", line 44, in <module>
from deeplab.core import nas_genotypes
File "D:DeepLabmodels-masterresearchdeeplabcorenas_genotypes.py", line 23, in <module>
from deeplab.core import nas_cell
File "D:DeepLabmodels-masterresearchdeeplabcorenas_cell.py", line 29, in <module>
from deeplab.core import xception as xception_utils
File "D:DeepLabmodels-masterresearchdeeplabcorexception.py", line 58, in <module>
from nets.mobilenet import conv_blocks as mobilenet_v3_ops
**File "D:DeepLabmodels-masterresearchslimnetsmobilenetconv_blocks.py", line 20, in <module>
import tf_slim as slim
ModuleNotFoundError: No module named 'tf_slim'**

我发现一些建议,这可能是与环境变量相关的,但我的都是正确的:env vars 我多次刷新了 Anaconda 窗口,以确保更改正在发生。

我的文件夹目录中有tf_slim:C:\Program Files\Python36\Lib\site-packages\tf_slim。

不知道该怎么做:(我对这种类型的安装很陌生。

我在窗口 10 上。

默认情况下,Anaconda 会创建一个虚拟环境,如果您通过 anaconda 提示符打开 python,则会打开虚拟环境中的 python 可执行文件。 这个虚拟环境将有自己的一组模块,不会引用系统级的python包。 我建议您打开 anaconda 提示符并键入以下命令:

点安装tf_slim

我相信

export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

在尝试模型测试之前,必须从内部tensorflow/models/research

但是,对于这个特定的错误,这表明缺少库,简单地这样做对我有用。

pip install tf_slim

尝试跑步

Export PYTHONPATH=$PYTHONPATH:’pwd’:’pwd’/slim

相关内容

  • 没有找到相关文章

最新更新