[Win11]Mask-RCNN 环境配置

[Win11]Mask-RCNN 环境配置

1. 安装tensorflow


//conda指令安装
conda install tensorflow-gpu=2.6
//验证安装成功
pyhon           //进入python环境
import tensorflow as tf  
print(tf.__version__)         //输出版本号
tf.test.is_gpu_available()     //输出“True”即为安装成功

2. 安装必要依赖包

  • tensorflow=2.6.0
  • keras=2.6.0
  • numpy、scipy、Pillow、cython、matplotlib、scikit-image、opencv-python、h5py、imgaug、Ipython[all]
  • 通过检查conda list 发现有些包已经安装好了,只需要把列表中没有的包再补充上就可以了

2.1 安装keras

pip install keras==2.6.0

2.2 安装Pillow

pip install pillow

(tf_gpu) C:\Users\nam>pip install pillow
Collecting pillow
  Downloading Pillow-9.5.0-cp38-cp38-win_amd64.whl (2.5 MB)
     ---------------------------------------- 2.5/2.5 MB 4.0 MB/s eta 0:00:00
Installing collected packages: pillow
Successfully installed pillow-9.5.0

2.3 安装cython

pip install cython

(tf_gpu) C:\Users\name>pip install cython
Collecting cython
  Downloading Cython-0.29.34-py2.py3-none-any.whl (988 kB)
     ---------------------------------------- 988.1/988.1 kB 1.2 MB/s eta 0:00:00
Installing collected packages: cython
Successfully installed cython-0.29.34

2.4 安装matplotlib

pip install matplotlib

(tf_gpu) C:\Users\ChiYaxin>pip install pillow
Collecting pillow
  Downloading Pillow-9.5.0-cp38-cp38-win_amd64.whl (2.5 MB)
     ---------------------------------------- 2.5/2.5 MB 4.0 MB/s eta 0:00:00
Installing collected packages: pillow
Successfully installed pillow-9.5.0

(tf_gpu) C:\Users\ChiYaxin>pip install cython
Collecting cython
  Downloading Cython-0.29.34-py2.py3-none-any.whl (988 kB)
     ---------------------------------------- 988.1/988.1 kB 1.2 MB/s eta 0:00:00
Installing collected packages: cython
Successfully installed cython-0.29.34

(tf_gpu) C:\Users\ChiYaxin>pip install matplotlib
Collecting matplotlib
  Downloading matplotlib-3.7.1-cp38-cp38-win_amd64.whl (7.6 MB)
     ---------------------------------------- 7.6/7.6 MB 4.3 MB/s eta 0:00:00
Requirement already satisfied: pillow>=6.2.0 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib) (9.5.0)
Collecting python-dateutil>=2.7
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ---------------------------------------- 247.7/247.7 kB 5.2 MB/s eta 0:00:00
Collecting importlib-resources>=3.2.0
  Downloading importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Requirement already satisfied: numpy>=1.20 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib) (1.23.5)
Collecting fonttools>=4.22.0
  Downloading fonttools-4.39.3-py3-none-any.whl (1.0 MB)
     ---------------------------------------- 1.0/1.0 MB 4.9 MB/s eta 0:00:00
Requirement already satisfied: packaging>=20.0 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib) (23.0)
Collecting cycler>=0.10
  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.4.4-cp38-cp38-win_amd64.whl (55 kB)
     ---------------------------------------- 55.4/55.4 kB 2.8 MB/s eta 0:00:00
Collecting contourpy>=1.0.1
  Downloading contourpy-1.0.7-cp38-cp38-win_amd64.whl (162 kB)
     ---------------------------------------- 163.0/163.0 kB 10.2 MB/s eta 0:00:00
Collecting pyparsing>=2.3.1
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
     ---------------------------------------- 98.3/98.3 kB 217.0 kB/s eta 0:00:00
Requirement already satisfied: zipp>=3.1.0 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from importlib-resources>=3.2.0->matplotlib) (3.11.0)
Requirement already satisfied: six>=1.5 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)
Installing collected packages: python-dateutil, pyparsing, kiwisolver, importlib-resources, fonttools, cycler, contourpy, matplotlib
Successfully installed contourpy-1.0.7 cycler-0.11.0 fonttools-4.39.3 importlib-resources-5.12.0 kiwisolver-1.4.4 matplotlib-3.7.1 pyparsing-3.0.9 python-dateutil-2.8.2

2.5 安装scikit-image

不知道为什么我用pip install scikit-image安装,提醒我有错误
所以我就用conda安装的
conda install scikit-image        //安装成功

2.6 安装opencv-python

pip install opencv-python

(tf_gpu) C:\Users\name>pip install opencv-python
Collecting opencv-python
  Downloading opencv_python-4.7.0.72-cp37-abi3-win_amd64.whl (38.2 MB)
     ---------------------------------------- 38.2/38.2 MB 3.4 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17.0 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from opencv-python) (1.23.5)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.7.0.72

2.7 安装imgaug

pip install imgaug

(tf_gpu) C:\Users\name>pip install imgaug
Collecting imgaug
  Downloading imgaug-0.4.0-py2.py3-none-any.whl (948 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 948.0/948.0 kB 625.2 kB/s eta 0:00:00
Requirement already satisfied: scikit-image>=0.14.2 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from imgaug) (0.19.3)
Requirement already satisfied: numpy>=1.15 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from imgaug) (1.23.5)
Requirement already satisfied: imageio in d:\anaconda3\envs\tf_gpu\lib\site-packages (from imgaug) (2.26.0)
Requirement already satisfied: matplotlib in d:\anaconda3\envs\tf_gpu\lib\site-packages (from imgaug) (3.7.1)
Requirement already satisfied: opencv-python in d:\anaconda3\envs\tf_gpu\lib\site-packages (from imgaug) (4.7.0.72)
Requirement already satisfied: six in d:\anaconda3\envs\tf_gpu\lib\site-packages (from imgaug) (1.16.0)
Requirement already satisfied: scipy in d:\anaconda3\envs\tf_gpu\lib\site-packages (from imgaug) (1.10.0)
Collecting Shapely
  Downloading shapely-2.0.1-cp38-cp38-win_amd64.whl (1.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 581.0 kB/s eta 0:00:00
Requirement already satisfied: Pillow in d:\anaconda3\envs\tf_gpu\lib\site-packages (from imgaug) (9.5.0)
Requirement already satisfied: PyWavelets>=1.1.1 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from scikit-image>=0.14.2->imgaug) (1.4.1)
Requirement already satisfied: networkx>=2.2 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from scikit-image>=0.14.2->imgaug) (2.8.4)
Requirement already satisfied: tifffile>=2019.7.26 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from scikit-image>=0.14.2->imgaug) (2021.7.2)
Requirement already satisfied: packaging>=20.0 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from scikit-image>=0.14.2->imgaug) (23.0)
Requirement already satisfied: python-dateutil>=2.7 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib->imgaug) (2.8.2)
Requirement already satisfied: pyparsing>=2.3.1 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib->imgaug) (3.0.9)
Requirement already satisfied: fonttools>=4.22.0 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib->imgaug) (4.39.3)
Requirement already satisfied: importlib-resources>=3.2.0 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib->imgaug) (5.12.0)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib->imgaug) (1.4.4)
Requirement already satisfied: contourpy>=1.0.1 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib->imgaug) (1.0.7)
Requirement already satisfied: cycler>=0.10 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from matplotlib->imgaug) (0.11.0)
Requirement already satisfied: zipp>=3.1.0 in d:\anaconda3\envs\tf_gpu\lib\site-packages (from importlib-resources>=3.2.0->matplotlib->imgaug) (3.11.0)
Installing collected packages: Shapely, imgaug
Successfully installed Shapely-2.0.1 imgaug-0.4.0

2.8 安装Ipython[all]

pip install ipython[all]

Successfully built curio atomicwrites
Installing collected packages: webencodings, wcwidth, sortedcontainers, snowballstemmer, Send2Trash, pywin32, pytz, pure-eval, pickleshare, mistune, ipython-genutils, fastjsonschema, executing, backcall, widgetsnbextension, websocket-client, webcolors, uri-template, tzdata, traitlets, tornado, tomli, toml, tinycss2, testpath, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, soupsieve, sniffio, rfc3986-validator, rfc3339-validator, qtpy, pyzmq, pywinpty, python-json-logger, pyrsistent, pygments, py, psutil, prompt-toolkit, prometheus-client, platformdirs, pkgutil-resolve-name, pathspec, parso, pandocfilters, outcome, nest-asyncio, mypy-extensions, jupyterlab-widgets, jupyterlab-pygments, Jinja2, iniconfig, imagesize, fqdn, exceptiongroup, entrypoints, docutils, defusedxml, decorator, debugpy, curio, bleach, babel, atomicwrites, async-generator, asttokens, alabaster, trio, terminado, stack-data, sphinx, pytest, pandas, matplotlib-inline, jupyter-core, jsonschema, jedi, comm, black, beautifulsoup4, arrow, argon2-cffi-bindings, anyio, sphinxcontrib-jquery, pytest-asyncio, nbformat, jupyter-server-terminals, jupyter-client, isoduration, ipython, docrepr, argon2-cffi, sphinx-rtd-theme, nbclient, ipykernel, qtconsole, nbconvert, jupyter-events, ipywidgets, ipyparallel, jupyter-server, notebook-shim, nbclassic, notebook
Successfully installed Jinja2-3.1.2 Send2Trash-1.8.0 alabaster-0.7.13 anyio-3.6.2 argon2-cffi-21.3.0 argon2-cffi-bindings-21.2.0 arrow-1.2.3 asttokens-2.2.1 async-generator-1.10 atomicwrites-1.4.1 babel-2.12.1 backcall-0.2.0 beautifulsoup4-4.12.0 black-23.3.0 bleach-6.0.0 comm-0.1.3 curio-1.6 debugpy-1.6.6 decorator-5.1.1 defusedxml-0.7.1 docrepr-0.2.0 docutils-0.18.1 entrypoints-0.4 exceptiongroup-1.1.1 executing-1.2.0 fastjsonschema-2.16.3 fqdn-1.5.1 imagesize-1.4.1 iniconfig-2.0.0 ipykernel-6.22.0 ipyparallel-8.5.1 ipython-8.12.0 ipython-genutils-0.2.0 ipywidgets-8.0.6 isoduration-20.11.0 jedi-0.18.2 jsonschema-4.17.3 jupyter-client-8.1.0 jupyter-core-5.3.0 jupyter-events-0.6.3 jupyter-server-2.5.0 jupyter-server-terminals-0.4.4 jupyterlab-pygments-0.2.2 jupyterlab-widgets-3.0.7 matplotlib-inline-0.1.6 mistune-2.0.5 mypy-extensions-1.0.0 nbclassic-0.5.4 nbclient-0.7.3 nbconvert-7.3.0 nbformat-5.8.0 nest-asyncio-1.5.6 notebook-6.5.3 notebook-shim-0.2.2 outcome-1.2.0 pandas-2.0.0 pandocfilters-1.5.0 parso-0.8.3 pathspec-0.11.1 pickleshare-0.7.5 pkgutil-resolve-name-1.3.10 platformdirs-3.2.0 prometheus-client-0.16.0 prompt-toolkit-3.0.38 psutil-5.9.4 pure-eval-0.2.2 py-1.11.0 pygments-2.14.0 pyrsistent-0.19.3 pytest-6.2.5 pytest-asyncio-0.20.3 python-json-logger-2.0.7 pytz-2023.3 pywin32-306 pywinpty-2.0.10 pyzmq-25.0.2 qtconsole-5.4.2 qtpy-2.3.1 rfc3339-validator-0.1.4 rfc3986-validator-0.1.1 sniffio-1.3.0 snowballstemmer-2.2.0 sortedcontainers-2.4.0 soupsieve-2.4 sphinx-6.1.3 sphinx-rtd-theme-1.2.0 sphinxcontrib-applehelp-1.0.4 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.1 sphinxcontrib-jquery-4.1 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 stack-data-0.6.2 terminado-0.17.1 testpath-0.6.0 tinycss2-1.2.1 toml-0.10.2 tomli-2.0.1 tornado-6.2 traitlets-5.9.0 trio-0.22.0 tzdata-2023.3 uri-template-1.2.0 wcwidth-0.2.6 webcolors-1.13 webencodings-0.5.1 websocket-client-1.5.1 widgetsnbextension-4.0.7

到目前为止,Mask-RCNN环境配置完成。

你可能感兴趣的:(python,tensorflow,深度学习)