tensorboard ImportError: cannot import name 'ReparseException'

环境:Mac os、Anaconda3

通过conda create -n tf36 python=3.6新建tensorflow的python环境,通过pip install tensorflow命令安装,启动tensorboard报错。

命令:tensorboard --logdir='path/to/log'

错误提示:ImportError: cannot import name 'ReparseException',表示从html5lib引入ReparseException错误。


解决方案:根据提示找到sanitizer.py文件,定位到报错内容:

import html5lib
from html5lib.constants import (
    entities,
    ReparseException,
    namespaces,
    prefixes,
    tokenTypes,
)
表示从html5lib.constant不能导入ReparseException,定位到 html5lib.constant,看看是否存在ReparseException,发现只存在_ReparseException:

修改sanitizer.py文件内容,将ReparseException替换为_ReparseException


重新运行命令:tensorboard --logdir='path/to/log'


在chrome中输入:http://localhost:6006/,出现以下内容,表示成功


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值