pytorch-deeplab 运行调试过程中遇到的一些问题

pytorch-deeplab 运行调试过程中遇到的一些问题,做一下记录。

1、ModuleNotFoundError: No module named 'tensorboardX' 
安装pytorch后使用tensorboardX出现“tensorboardX:未找到命令”错误,未安装Pytorch可视化工具tensorboardX

解决方法:
(1)首先默认你已经安装好pytorch。
(2)安装tensorboardX:cmd -> pip install tensorboardX,等待安装完成即可。
(3)测试成功
#Tensorboard的使用,图像变换transform的使用
from tensorboardX  import SummaryWriter
writer=SummaryWriter("log")

for i in range(100):
    writer.add_scalar("y=x",i,i)
writer.close()


2、OSError: cannot identify image file 'dog.jpg'
解决方法:
Pillow的版本过低,需要升级。
先卸载低版本:pip uninstall Pillow
再重新安装:pip install Pillow

3、No module named 'pycocotools'
    from pycocotools.coco import COCO
ModuleNotFoundError: No module named 'pycocotools'
解决方法:具体解释,点此链接:https://github.com/philferriere/cocoapi
在 GIT官网(https://git-scm.com/downloads/)上下载git,并安装,下载安装成功后,打开Git CMD执行命令:pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

或者:

cmd——>pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
等待安装完成,可能要好几分钟,安心等待。


4、SyntaxError: Non-UTF-8 code starting with '\xe6' in file train.py
导致出错的根源就是编码问题。由于我的程序中有中文注释,中文报错。
解决方案是:
在程序最上面加上:
# coding=gbk

参考:

扫描二维码关注公众号,回复: 12673920 查看本文章

https://github.com/philferriere/cocoapi

猜你喜欢

转载自blog.csdn.net/yishuihanq/article/details/109700019