histolab安装教程

1.新建conda虚拟环境

conda create -n pytorch_1 python=3.9.7

关于conda虚拟环境的教程,详见: 【恒源智享云】conda虚拟环境的操作指令

2.进入刚刚新建的虚拟环境

conda activate pytorch_1

关于conda虚拟环境的教程,详见: 【恒源智享云】conda虚拟环境的操作指令

3.pip安装histolab

pip install histolab

在这里插入图片描述
在这里插入图片描述

4.运行python文件尝试,是否安装成功

python文件内容如下:

from histolab.tiler import ScoreTiler
from histolab.scorer import NucleiScorer

scored_tiles_extractor = ScoreTiler(
    scorer = NucleiScorer(),
    tile_size=(512, 512),
    n_tiles=100,
    level=0,
    check_tissue=True,
    tissue_percent=80.0,
    pixel_overlap=0, # default
    prefix="scored/", # save tiles in the "scored" subdirectory of slide's processed_path
    suffix=".png" # default
)

print("没问题!")
python WSI_patcher.py

如果没有报错,则安装成功!到此结束。
在这里插入图片描述

5.报错OSError: libopenslide.so.0: cannot open shared object file: No such file or directory

如果运行python文件出现如下错误:
在这里插入图片描述

可以依次运行以下几条指令:

sudo apt-get install openslide-tools
sudo apt-get install
sudo apt-get install python3-openslide

解决error啦!
在这里插入图片描述

参考博客

ERROR解决部分来自:
https://blog.csdn.net/qq_36717487/article/details/117201316
感谢大佬的分享,本博客只用作学习笔记,侵删!

更多推荐