项目中执行 import torchxrayvision as xrv时出现以下错误:
traceback (most recent call last):
file "d:/研究生/毕业设计/covid19/covid19_ct/conduct.py", line 14, in
import torchxrayvision as xrv
file "d:\研究生\毕业设计\covid19\covid19_ct\torchxrayvision\__init__.py", line 1, in
from . import datasets
file "d:\研究生\毕业设计\covid19\covid19_ct\torchxrayvision\datasets.py", line 3, in
from skimage.io import imread, imsave
modulenotfounderror: no module named 'skimage'
既然是因为缺少skimage文件所引起的报错,那么我们就通过pip install scikit-image
命令来安装它。
looking in indexes: https://mirrors.aliyun.com/pypi/simple
collecting scikit-image
downloading https://mirrors.aliyun.com/pypi/packages/6e/c7/6411a4ce983bf06db8c3b8093b04b268c2580816f61156a5848e24e97118/scikit_image-0.17.2-cp37-cp37m-win_amd64.whl (11.5 mb)
|████████████████████████████████| 11.5 mb 6.4 mb/s
collecting networkx>=2.0
downloading https://mirrors.aliyun.com/pypi/packages/41/8f/dd6a8e85946def36e4f2c69c84219af0fa5e832b018c970e92f2ad337e45/networkx-2.4-py3-none-any.whl (1.6 mb)
|████████████████████████████████| 1.6 mb 6.4 mb/s
collecting pywavelets>=1.1.1
downloading https://mirrors.aliyun.com/pypi/packages/87/e1/c3d97d145ce3377c53f1feca5742ca2b2a38c34dcbe301e2212de3cc654d/pywavelets-1.1.1-cp37-cp37m-win_amd64.whl (4.2 mb)
|████████████████████████████████| 4.2 mb 3.3 mb/s
collecting imageio>=2.3.0
downloading https://mirrors.aliyun.com/pypi/packages/6e/57/5d899fae74c1752f52869b613a8210a2480e1a69688e65df6cb26117d45d/imageio-2.9.0-py3-none-any.whl (3.3 mb)
|████████████████████████████████| 3.3 mb 6.4 mb/s
requirement already satisfied: numpy>=1.15.1 in d:\anaconda3\envs\pytorch_1.4_gpu\lib\site-packages (from scikit-image) (1.19.1)
collecting tifffile>=2019.7.26
downloading https://mirrors.aliyun.com/pypi/packages/3f/51/151f2c5b89af5a3ebbe9d1078ce598abeeb6802b6cf568350914746d1c4c/tifffile-2020.8.13-py3-none-any.whl (146 kb)
|████████████████████████████████| 146 kb ...
requirement already satisfied: scipy>=1.0.1 in d:\anaconda3\envs\pytorch_1.4_gpu\lib\site-packages (from scikit-image) (1.5.2)
collecting matplotlib!=3.0.0,>=2.0.0
downloading https://mirrors.aliyun.com/pypi/packages/af/e9/921fb9895bfa8afd93515702ac57a4c63345333c9920d3d1b81f6330e9a2/matplotlib-3.3.1-cp37-cp37m-win_amd64.whl (8.5 mb)
|████████████████████████████████| 8.5 mb 6.4 mb/s
requirement already satisfied: pillow!=7.1.0,!=7.1.1,>=4.3.0 in d:\anaconda3\envs\pytorch_1.4_gpu\lib\site-packages (from scikit-image) (7.2.0)
collecting decorator>=4.3.0
downloading https://mirrors.aliyun.com/pypi/packages/ed/1b/72a1821152d07cf1d8b6fce298aeb06a7eb90f4d6d41acec9861e7cc6df0/decorator-4.4.2-py2.py3-none-any.whl (9.2 kb)
collecting kiwisolver>=1.0.1
downloading https://mirrors.aliyun.com/pypi/packages/7e/e5/d8bd2d063da3b6761270f29038d2bb9785c88ff385009bf61589cde6e6ef/kiwisolver-1.2.0-cp37-none-win_amd64.whl (57 kb)
|████████████████████████████████| 57 kb 1.5 mb/s
collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
downloading https://mirrors.aliyun.com/pypi/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl (67 kb)
|████████████████████████████████| 67 kb 2.8 mb/s
requirement already satisfied: certifi>=2020.06.20 in d:\anaconda3\envs\pytorch_1.4_gpu\lib\site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image) (2020.6.20)
collecting python-dateutil>=2.1
downloading https://mirrors.aliyun.com/pypi/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227 kb)
|████████████████████████████████| 227 kb 3.3 mb/s
collecting cycler>=0.10
downloading https://mirrors.aliyun.com/pypi/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl (6.5 kb)
requirement already satisfied: six>=1.5 in d:\anaconda3\envs\pytorch_1.4_gpu\lib\site-packages (from python-dateutil>=2.1->matplotlib!=3.0.0,>=2.0.0->scikit-image) (1.15.0)
installing collected packages: decorator, networkx, pywavelets, imageio, tifffile, kiwisolver, pyparsing, python-dateutil, cycler, matplotlib, scikit-image
successfully installed pywavelets-1.1.1 cycler-0.10.0 decorator-4.4.2 imageio-2.9.0 kiwisolver-1.2.0 matplotlib-3.3.1 networkx-2.4 pyparsing-2.4.7 python-dateutil-2.8.1 scikit-image-0.17.2 tifffile-2020.8
.13
问题解决。