Advertisement

成功解决tensorflow.keras: AttributeError: ‘str‘ object has no attribute ‘decode‘

阅读量:

在使用tensorflow.keras过程中,出现了AttributeError错误,提示‘str’对象不存在decode属性。针对此问题,其解决过程可分为两个步骤,首先需要检查自身所使用的版本是否匹配。

在这里插入图片描述

【接下来若版本匹配恰当

则存在如下因素:

“h5py的版本过高,只需将其降级至合适版本即可:

首先需移除当前已安装的版本
通过执行命令 pip uninstall h5py 进行卸载
随后进行安装操作
使用 pip install h5py==2.10.0 -i http://pypi.douban.com/ simple / --trusted-host pypi.douban.com 命令完成安装

即可有效解决此问题!”

全部评论 (0)

还没有任何评论哟~