运行代码报错:

from tensorboardX import SummaryWriter

报错内容:

发生异常: TypeError
Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
 

=================================================

根据报错信息提供的链接:

https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

根据官方给出的资料,可以知道Google的序列化协议protobuf已经由版本3.20.1升级到4.21.6,一些需要调用旧版本protobuf的python库将出错,这种情况需要通过设置环境变量或者安装旧版本的protobuf来解决。

查看一下本地的protobuf版本:

pip list

显示:

大概率确定是安装的protobuf版本高了的问题,更新低版本的protobuf,具体操作:

pip install --upgrade protobuf==3.20.1

------------------------------------------------------

再次运行,不报错,成功解决。

使用tensorbaoardx报错——Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.的更多相关文章

  1. iptables报错:Couldn't load target `accept':/lib64/iptables/libipt_accept.so: cannot open shared object file: No such file or directory

    语句:iptables -A INPUT -s 134.192.204.235 -p TCP --dport 11211 -j accept 报错:Couldn't load target `acce ...

  2. 解决SharePoint 文档库itemadded eventhandler导致的上传完成后,编辑页面保持报错的问题,错误信息为“该文档已经被编辑过 the file has been modified by...”

    在文档库中添加itemadded 后,在上传文件后,会自动打开文档属性的编辑页面,在保存的时候就会报错,说这个文档已经被编辑过了.这是应为默认itemadded实践是异步执行的,会在edit页面打开之 ...

  3. python读取文件报错:pandas.errors.ParserError: iterator should return strings, not bytes (did you open the file in text mode?)

    python 读取csv文件报错问题 import csv with open('E:/Selenium2script/DDT模块/test.csv','rb') as f: readers = cs ...

  4. Centos6.8 yum报错及修复YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid

    问题 使用yum安装软件时报错 YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid relea ...

  5. Nginx 报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory) 的解决方法

    今天测试域名访问不了,登陆 Linux(Ubuntu)重启Nginx: nginx -s reload 结果报错: nginx: [error] open() : No such file or di ...

  6. 初始化mysql报错bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

    原因:缺少libaio.so.1 解决办法:安装即可 yum install -y libaio

  7. 【原创】大叔问题定位分享(3)Kafka集群broker进程逐个报错退出

    kafka0.8.1 一 问题现象 生产环境kafka服务器134.135.136分别在10月11号.10月13号挂掉: 134日志 [2014-10-13 16:45:41,902] FATAL [ ...

  8. Oracle报错ORA-16433非归档丢失redo无法启动的恢复过程

    [案例]Oracle报错ORA-16433非归档丢失redo无法启动的恢复过程 转惜纷飞 今天ML的群中女神和travel在纠结一个恢复的问题,11.2.0.3版本,非归档,大概是rm掉current ...

  9. ubuntu下tensorflow 报错 libcusolver.so.8.0: cannot open shared object file: No such file or directory

    解决方法1. 在终端执行: export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64” export CUDA_HOME=/usr/ ...

  10. openstack Train版 “nova-status upgrade check”报错:Forbidden: Forbidden (HTTP 403)

    部署openstack train版,在部署完nova项目时,进行检查,执行 nova-status upgrade check 返回报错信息如下: [root@controller ~]# nova ...

随机推荐

  1. spring与设计模式之三代理模式

    部分内容引用: https://blog.csdn.net/shulianghan/article/details/119798155 一.定义 1.1定义 对于现实生活中的代理,大家非常好理解.我们 ...

  2. tortoisegit 配置ssh登录

    习惯使用小乌龟. 服务器:gitblit 客户端:TortoiseGit 2.13.0.1 (C:\Program Files\TortoiseGit\bin) git version 2.36.1. ...

  3. Oracle常用统计

    测试, 这是测消息 1.按天 select to_char(t.STARTDATE+15/24, 'YYYY-MM-DD') as 天,sum(1) as 数量from HOLIDAY tgroup ...

  4. LaravelLumen 分组求和问题 where groupBy sum

    在Laravel中使用分组求和,如果直接使用Laravel各数据库操作方法,应该会得出来如下代码式: DB::table('table_a') ->where('a','=',1) ->g ...

  5. ENVI无缝镶嵌、拼接栅格数据的方法

      本文介绍基于ENVI软件,利用"Seamless Mosaic"工具实现栅格遥感影像无缝镶嵌的操作.   在遥感图像镶嵌拼接:ENVI的Pixel Based Mosaicki ...

  6. DASCTF X GFCTF 2024|四月开启第一局 [PWN]详解

    DASCTF X GFCTF 2024|四月开启第一局[PWN] wp(详解) 1.dynamic_but_static 题目保护情况 64位程序,没有开canary和pie保护,got表可改 64位 ...

  7. webpack4.15.1 学习笔记(十) — 常见 loader 使用

    目录 style -loader <= css-loader <= less-loader postcss-loader file-loader url-loader html-withi ...

  8. PixiJS源码分析系列:第二章 渲染在哪里开始?

    第二章 渲染在哪里开始? 牢记,按第一章介绍的 npm start 启动本地调式环境才可进行调式 如果是 example 文件夹内的例子还需要 serve . 开启本地静态服务器 上一章介绍了 Pix ...

  9. PowerShell 使用 Azure

    PowerShell 使用 Azure Azure 提供了三种管理工具: Azure 门户:Azure 门户是一个网站,可在其中创建.配置和更改 Azure 订阅中的资源,该门户是一个图形用户界面 ( ...

  10. 结构体_C

    // Code file created by C Code Develop #include "ccd.h" #include "stdio.h" #incl ...