码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2021-06-02 19:29:42      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:attr   last   int   from   objects   tee   ras   intern   with   

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



 

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

标签:attr   last   int   from   objects   tee   ras   intern   with   

原文地址:https://www.cnblogs.com/emanlee/p/14833811.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!