当前位置:网站首页>Solution: attributeerror: 'STR' object has no attribute 'decode‘
Solution: attributeerror: 'STR' object has no attribute 'decode‘
2022-07-06 02:36:00 【Grasp*】
Catalog
1 Introduction to the environment
1 Introduction to the environment
Deep learning framework version and corresponding python The environment version is as follows :
TensorFlow2.1.0+keras2.3.1+python36
2 Error message :
File "D:\Python36\lib\site-packages\keras\engine\saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)
File "D:\Python36\lib\site-packages\keras\engine\saving.py", line 584, in load_model
model = _deserialize_model(h5dict, custom_objects, compile)
File "D:\Python36\lib\site-packages\keras\engine\saving.py", line 273, in _deserialize_model
model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'
3 Problem analysis
In the above environment , load .h5 Deep learning model , The error that the message character cannot be decoded , The probability is that a package version is incompatible . What exactly is incompatible , You can see this sentence from the error message :
model = _deserialize_model(h5dict, custom_objects, compile)
Current environment pair h5 There is a problem that deserialization cannot be carried out when processing files , Search for information and find :
When we install tensorflow2.1.0 When , It will be automatically installed for us h5py The version is 3.1.0. However tensorflow2.1.0 Support h5py<3.0.0, This is the root cause of the above error report .
4 Problem finding
Search online :
Click in the first
Found a lot of support python3.6 After h5py edition , Which one to use ?
Search further :
Find many corresponding , Just click in to find your corresponding version . The above just shows the way to find the answer , For no other purpose .
5 Final solution
First uninstall the original h5py-3.1.0
Then install the matching h5py edition
Finally complete the installation
Open the settings and have a look
Installation successful !
I hope it will be useful to the students I see ~
There is another error in the installation process , If there is a solution , Welcome to leave a message ~
边栏推荐
- 继承的构造函数
- 从顶会论文看2022年推荐系统序列建模的趋势
- Global and Chinese markets of screw rotor pumps 2022-2028: Research Report on technology, participants, trends, market size and share
- HDU_p1237_简单计算器_stack
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14
- 2345文件粉碎,文件强力删除工具无捆绑纯净提取版
- 剑指 Offer 29. 顺时针打印矩阵
- Zero basic self-study STM32 wildfire review of GPIO use absolute address to operate GPIO
- Force buckle 146 LRU cache
- Six stone management: why should leaders ignore product quality
猜你喜欢
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
LeetCode 103. Binary tree zigzag level order transverse - Binary Tree Series Question 5
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15
GifCam v7.0 极简GIF动画录制工具中文单文件版
Black high-end responsive website dream weaving template (adaptive mobile terminal)
Shell script updates stored procedure to database
Qt发布exe软件及修改exe应用程序图标
微软语音合成助手 v1.3 文本转语音工具,真实语音AI生成器
2022 edition illustrated network pdf
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
随机推荐
Spherical lens and cylindrical lens
A copy can also produce flowers
"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.5 automatic differentiation_ Learning thinking and exercise answers
Differences and usage scenarios between TCP and UDP
Is there a case where sqlcdc monitors multiple tables and then associates them to sink to another table? All operations in MySQL
What should we pay attention to when using the built-in tool to check the health status in gbase 8C database?
一位博士在华为的22年
High number_ Vector algebra_ Unit vector_ Angle between vector and coordinate axis
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
How to improve the enthusiasm of consumers when the member points marketing system is operated?
2020.02.11
【社区人物志】专访马龙伟:轮子不好用,那就自己造!
零基础自学STM32-复习篇2——使用结构体封装GPIO寄存器
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
零基础自学STM32-野火——GPIO复习篇——使用绝对地址操作GPIO
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
Y a - t - il des cas où sqlcdc surveille plusieurs tables et les associe à une autre? Tout fonctionne dans MySQL
General process of machine learning training and parameter optimization (discussion)
A doctor's 22 years in Huawei