简体   繁体   English

_api/v1/keras/ 和 python/keras 之间的 tensorflow/keras utils 模块混淆

[英]tensorflow/keras utils module confusion between _api/v1/keras/ and python/keras

I just try to import vis_utils from tensorflow.keras but it gives me我只是尝试导入vis_utilstensorflow.keras ,但它给了我

>>> import tensorflow.keras.utils.vis_utils
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'tensorflow.keras.utils.vis_utils'

Checking the location of utils tells me that it points to the wrong (?) directory:检查 utils 的位置告诉我它指向错误的 (?) 目录:

>>> print(tensorflow.keras.utils.__file__)
/usr/local/lib/python3.5/dist-packages/tensorflow/_api/v1/keras/utils/__init__.py

But it should actually point to /usr/local/lib/python3.5/dist-packages/tensorflow/python/keras/utils/__init__.py I've installed everything via pip and tf version is 1.12 on my vanilla Ubuntu 16.04.但它实际上应该指向/usr/local/lib/python3.5/dist-packages/tensorflow/python/keras/utils/__init__.py我已经通过 pip 安装了所有东西,tf 版本在我的 vanilla Ubuntu 16.04 上是 1.12。 Is the installation tainted or how do tell python to load the correct module?安装是否受污染或如何告诉 python 加载正确的模块?

import tensorflow.python.keras.utils.vis_utils应该可以工作。

暂无
暂无

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

相关问题 模块“tensorflow.python.keras.api._v2.keras.layers”没有属性“CuDNNLSTM” - module 'tensorflow.python.keras.api._v2.keras.layers' has no attribute 'CuDNNLSTM' AttributeError:模块“tensorflow_core.python.keras.api._v2.keras.activations”没有属性“swish” - AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.activations' has no attribute 'swish' 模块“tensorflow.python.keras.utils.generic_utils”没有属性“populate_dict_with_module_objects” - module 'tensorflow.python.keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects' AttributeError:模块'tensorflow.python.keras.utils.generic_utils'没有属性'populate_dict_with_module_objects' - AttributeError: module 'tensorflow.python.keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects' tensorflow keras:我收到此错误“模块“tensorflow._api.v1.keras.layers”没有属性“flatten” - tensorflow keras: I am getting this error 'module "tensorflow._api.v1.keras.layers' has no attribute 'flatten'" AttributeError:模块“tensorflow_core.python.keras.api._v2.keras.losses”没有属性“softmax_cross_entropy” - AttributeError: module 'tensorflow_core.python.keras.api._v2.keras.losses' has no attribute 'softmax_cross_entropy' 我该如何解决这个问题:AttributeError:模块'tensorflow_core.python.keras.api._v2.keras'没有属性'Dense' - how can i fix this : AttributeError: module 'tensorflow_core.python.keras.api._v2.keras' has no attribute 'Dense' “tensorflow.python.keras.utils.generic_utils”没有属性“populate_dict_with_module_objects” - 'tensorflow.python.keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects' 未解决的“tensorflow.python.keras.utils.generic_utils”没有属性“populate_dict_with_module_objects” - Unsolved 'tensorflow.python.keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects' python 代码中没有名为 'tensorflow.python.keras.engine.base_layer_v1'的模块 - No module named 'tensorflow.python.keras.engine.base_layer_v1' in python code with tensor flow keras
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM