我是靠谱客的博主 心灵美蜜粉,这篇文章主要介绍python 导入magenta失败,报AttributeError错误解决办法,现在分享给大家,希望可以做个参考。

如图:

1、第一次报错信息:    

       AttributeError: module 'tensorflow' has no attribute 'python_io

       根据提示路径,打开note_sequence_io.py文件,找到 class NoteSequenceRecordWriter(tf.python_io.TFRecordWriter)将tf.python_io.TFRecordWriter改成tf.io.TFRecordWriter

2、再次导入,上面的报错信息没有出现了,但出现了新的报错信息:

      AttributeError: module 'tensorflow' has no attribute 'logging'  

     根据提示路径,打开statistics.py文件,找到  def log_statistics_list(stats_list, logger_fn=tf.logging.info):将logger_fn=tf.logging.info改成tf._logging.info, 即在logging前加了个下划线

    问题解决。

  终究原因还是版本的不兼容引起的。本问题使用的magenta版本是1.1.3,tensorflow版本是2.0.0b1

 

 

最后

以上就是心灵美蜜粉最近收集整理的关于python 导入magenta失败,报AttributeError错误解决办法的全部内容,更多相关python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(82)

评论列表共有 0 条评论

立即
投稿
返回
顶部