【table master mmocr】Windows下的环境配置

TableMASTER-mmocr运行环境搭建

pwd:TableMASTER-mmocr-master

# conda环境
conda create -n record python=3.8

1.pytorch(改用conda安装,同时安装cuda)

# pytorch 1.10.1   CUDA 11.3
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge

这里有网页提议去掉-c pytorch才能真正使用镜像下载。(但我的镜像好像去掉-c好像不行)

好吧,不要删掉,详见这篇博客,和这个笔记。所以正确换源后运行上面的命令即可

参考:
conda镜像配置可看这个

https://blog.csdn.net/qq_42888454/article/details/122046247

https://blog.csdn.net/qq_41719643/article/details/117877911

https://blog.csdn.net/m0_53159830/article/details/123291139

http://t.zoukankan.com/moonfan-p-15519116.html

安装好之后请用环境的pytorch检测cuda是否正常可用,如果不行,请另想办法

#判断是否安装了cuda
import torch
print(torch.cuda.is_available())  #返回True则说明已经安装了cuda

#判断是否安装了cuDNN
from torch.backends import  cudnn 
print(cudnn.is_available())  #返回True则说明已经安装了cuDNN

2.按照REAMD.md进行installation

注意:requirements的两个lanms-proper要换成lanms-neo

Install mmdetection. click here for details.

# We embed mmdetection-2.11.0 source code into this project.
# You can cd and install it (recommend).
cd ./mmdetection-2.11.0
pip install -v -e .

Install mmocr. click here for details.

# install mmocr
cd ..
pip install -v -e .

3.mmcv-full(1.2.4-1.4.0)

可以去官方文档找到对应版本,这里直接给了可行的对应 pytorch 1.10.1 CUDA 11.3 的版本

pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10/index.html

4.运行demo

真正的demo在 ./table_recognition/demo,有README.md可以看

直接运行

python ./table_recognition/demo/demo.py

此时会报错没有tqdm,直接pip安装了就好,

pip install tqdm

然后再运行就没问题了。

但是里面路径会报错,直接修改模型路径过去。详见顺利运行demo教程

如果在运行demo时出现这些已知问题,可以直接照着改(但是这个配置就是出了这些问题解决了的啊)。

posted @ 2023-01-06 23:04  faf4r  阅读(416)  评论(0)    收藏  举报