![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
雨歇微凉
这个作者很懒,什么都没留下…
展开
-
已解决:module ‘google.protobuf.descriptor‘ has no attribute ‘_internal_create_key‘
今天在虚拟机中想使用 keras_tuner,结果导入 keras_tuner 之后在 jupyter 中报错:module ‘google.protobuf.descriptor’ has no attribute '_internal_create_key’在终端的 python 中也报同样的错误在百度之后显示是 protobuf 版本过低,于是使用:pip install --upgrade protobuf对 protobuf 进行更新,在终端 python 中验证后,发现不报错了但是回原创 2021-10-14 19:53:23 · 5942 阅读 · 0 评论 -
python 代码处理压缩数据包
代码成功执行后,存放在 /home/hmai 下的 aaa.zip 压缩包被整体解压到路径 /home/hmai/tensorflow 文件夹中import zipfile# 定义压缩文件所在路径zip_path = "/home/hmai/aaa.zip"# 调用 zipfile.ZipFile 方法操作 zip 类型压缩包# 第一个参数表示要解压文件路径,mode表示模式,为 r 时表示读取一个已存在的文件zip_ref = zipfile.ZipFile(zip_path,mode=原创 2021-10-12 18:14:42 · 257 阅读 · 0 评论