运行代码报错:

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. List<Map<String, Object>> 按照时间排序

    // 准备一个集合 List<Map<String, Object>> resList= Lists.newArrayList(); Map<String, Object ...

  2. Feign的客户端注解@EnableFeignClients,解决No qualifying bean of type 'xx.xx.类' available注入报错

    //如果使用Feign的客户端,请放开下列注释@EnableFeignClientsNo qualifying bean of type 'xx.xx.类' available //需要添加扫描的路径 ...

  3. java关于json的一些问题

    今天重写代码的时候,发现了一个异常:java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntim ...

  4. EasyExcel 无法读取图片?用poi写了一个工具类

    在平时的开发中,经常要开发 Excel 的导入导出功能.一般使用 poi 或者 EasyExcel 开发,使用 poi 做 excel 比较复杂,大部分开发都会使用 EasyExcel 因为一行代码就 ...

  5. .NET 高效灵活的API速率限制解决方案

    前言 FireflySoft.RateLimit是基于.NET Core和.NET Standard构建,支持多种速率限制算法和策略,包括固定窗口.滑动窗口.漏桶.令牌桶等.通过简单的配置和集成,开发 ...

  6. 使用 GPU 进行 Lightmap 烘焙 - 简单 demo

    作者:i_dovelemon 日期:2024-06-16 主题:Lightmap, PathTracer, Compute Shader 引言 一直以来,我都对离线 bake lightmap 操作很 ...

  7. Ubuntu下nvidia驱动卸载

    Ubuntu下nvidia驱动卸载的一种方法 卸掉已经安装的驱动: sudo apt-getremove --purge '^nvidia-.*' sudo apt-getremove --purge ...

  8. libevent之bufferevents

    目录 Bufferevents:概念和基础知识 Bufferevents 和 evbuffers 回调和水印 延迟回调 缓冲区事件的选项标志 使用基于套接字的缓冲区事件 创建基于套接字的缓冲区事件 在 ...

  9. Linux greybus

    背景 在研究高通平台驱动震动马达时,我需要为内核驱动实现以下功能:/sys/class/timed_output/vibrator/enable":sysfs文件系统注册接口.提供show. ...

  10. 3568F-麒麟KylinOS国产操作系统演示案例