zoukankan      html  css  js  c++  java
  • module 'tensorflow.compat.v2' has no attribute '__internal__

    from keras.utils import to_categorical  

    module 'tensorflow.compat.v2' has no attribute '__internal__


    from keras.utils import to_categorical

    $ python testerr.py


    Using TensorFlow backend.
    Traceback (most recent call last):
      File "testerr.py", line 5, in <module>
        from keras.utils import to_categorical
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
        from . import utils
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/utils/__init__.py", line 26, in <module>
        from .vis_utils import model_to_dot
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/utils/vis_utils.py", line 7, in <module>
        from ..models import Model
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/models.py", line 10, in <module>
        from .engine.input_layer import Input
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/engine/__init__.py", line 3, in <module>
        from .input_layer import Input
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/engine/input_layer.py", line 7, in <module>
        from .base_layer import Layer
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/engine/base_layer.py", line 12, in <module>
        from .. import initializers
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/initializers/__init__.py", line 124, in <module>
        populate_deserializable_objects()
      File "/home/sqxiong/anaconda3/envs/tens/lib/python3.6/site-packages/keras/initializers/__init__.py", line 49, in populate_deserializable_objects
        LOCAL.GENERATED_WITH_V2 = tf.__internal__.tf2.enabled()
    AttributeError: module 'tensorflow.compat.v2' has no attribute '__internal__'
    (tens) [sqxiong@ibiomed plek_attention]$ python testerr.py ^C
    (tens) [sqxiong@ibiomed plek_attention]$ vim testerr.py



  • 相关阅读:
    MQTT初步使用
    越简单越喜欢
    大端小端
    Chapter 21_5.2 tab扩展
    Chapter 21_5.1 URL编码
    Chapter 21_5 替换
    插件api
    怎么找到一个好名字idea插件开发
    Struts2 maven项目简单案例
    javassist_1 cannot be cast to jaassist.util.proxy.Proxy
  • 原文地址:https://www.cnblogs.com/emanlee/p/14833811.html
Copyright © 2011-2022 走看看