当前位置:网站首页>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 ~
边栏推荐
- Lecture 4 of Data Engineering Series: sample engineering of data centric AI
- 2022 China eye Expo, Shandong vision prevention and control exhibition, myopia, China myopia correction Exhibition
- Sword finger offer 29 Print matrix clockwise
- JS events (add, delete) and delegates
- 07 单件(Singleton)模式
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
- Global and Chinese markets of general purpose centrifuges 2022-2028: Research Report on technology, participants, trends, market size and share
- 【无标题】数据库中一条查询SQL执行的过程
- Compact lidar global and Chinese markets 2022-2028: technology, participants, trends, market size and share Research Report
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
猜你喜欢
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19](/img/7c/f728e88ca36524f92c56213370399b.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19

Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I

2345文件粉碎,文件强力删除工具无捆绑纯净提取版
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16](/img/c3/f3746b161012acc3751b2bd0b8f663.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16

如何精准识别主数据?

QT release exe software and modify exe application icon

The third level of C language punch in

剑指 Offer 29. 顺时针打印矩阵
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14](/img/c5/dde92f887e8e73d7db869fcddc107f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14

从顶会论文看2022年推荐系统序列建模的趋势
随机推荐
Global and Chinese markets of screw rotor pumps 2022-2028: Research Report on technology, participants, trends, market size and share
How to generate rich text online
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
HDU_ p1237_ Simple calculator_ stack
inherited constructors
技术管理进阶——什么是管理者之体力、脑力、心力
GifCam v7.0 极简GIF动画录制工具中文单文件版
SSM assembly
DDoS "fire drill" service urges companies to be prepared
Global and Chinese markets hitting traffic doors 2022-2028: Research Report on technology, participants, trends, market size and share
MySQL winter vacation self-study 2022 11 (6)
Sword finger offer 30 Stack containing min function
"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.3 linear algebra_ Learning thinking and exercise answers
MySQL winter vacation self-study 2022 11 (9)
Dachang image library
Reset nodejs of the system
[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation
I changed the driver to 5.1.35, but it is still the same error. I can succeed even now, but I will report this every time I do an SQL operation
HDU_p1237_简单计算器_stack
QT release exe software and modify exe application icon