ZT台式机 Tensorflow配置
1、安装Anaconda (最好不要安装在C盘)
安装参考:https://blog.csdn.net/weixin_50888378/article/details/109022585
2、安装Protoc
①解压protoc-3.11.4-win64.zip
②配置环境,在桌面上选中“此电脑”,单击右键,在弹出菜单中选择 “属性”,电脑自动打开系统属性面板,在面板左侧菜单栏中选择 “高级系统设置”菜单选项,系统自动打开系统属性配置对话框,点击下面的“配置环境变量(N)...”按钮,在系统变量面板下点击“新建(W)...”按钮,
变量名:Protoc
变量值:E:Program Files (x86)protoc-3.11.4-win64
然后点击“确定”按钮。
在系统变量里面选中变量名为 Path 的选项,双击,系统自动打开 编辑环境变量面板,在最下面空白行点双击,输入:%Protoc%in,然后点击“确定”按钮。
依次点击确定按钮关闭刚才打开的窗口,Protoc环境变量配置完毕。
解压目录下有
bin
include
readme.txt
上面两步配置完毕以后,在操作系统开始菜单中打开: Anaconda Prompt
(base) C:Userszzt> (base) C:Userszzt> (base) C:Userszzt> (base) C:Userszzt> (base) C:Userszzt>E: (base) E:> (base) E:> (base) E:> (base) E:> (base) E:> (base) E:> (base) E:> (base) E:>cd Anaconda3 (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3>conda create -n tf_2021 python=3.7 Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 4.5.11 latest version: 4.10.1 Please update conda by running $ conda update -n base -c defaults conda ## Package Plan ## environment location: C:UserszztAppDataLocalcondacondaenvs f_2021 added / updated specs: - python=3.7 The following packages will be downloaded: package | build ---------------------------|----------------- certifi-2020.12.5 | py37haa95532_0 144 KB openssl-1.1.1k | h2bbff1b_0 5.7 MB python-3.7.10 | h6244533_0 17.4 MB vc-14.2 | h21ff451_1 8 KB setuptools-52.0.0 | py37haa95532_0 936 KB wheel-0.36.2 | pyhd3eb1b0_0 31 KB vs2015_runtime-14.27.29016 | h5e58377_2 2.2 MB ca-certificates-2021.4.13 | haa95532_1 150 KB sqlite-3.35.4 | h2bbff1b_0 1.2 MB pip-21.0.1 | py37haa95532_0 2.0 MB ------------------------------------------------------------ Total: 29.8 MB The following NEW packages will be INSTALLED: ca-certificates: 2021.4.13-haa95532_1 certifi: 2020.12.5-py37haa95532_0 openssl: 1.1.1k-h2bbff1b_0 pip: 21.0.1-py37haa95532_0 python: 3.7.10-h6244533_0 setuptools: 52.0.0-py37haa95532_0 sqlite: 3.35.4-h2bbff1b_0 vc: 14.2-h21ff451_1 vs2015_runtime: 14.27.29016-h5e58377_2 wheel: 0.36.2-pyhd3eb1b0_0 wincertstore: 0.2-py37_0 Proceed ([y]/n)? y Downloading and Extracting Packages certifi-2020.12.5 | 144 KB | ############################################################################ | 100% openssl-1.1.1k | 5.7 MB | ############################################################################ | 100% python-3.7.10 | 17.4 MB | ############################################################################ | 100% vc-14.2 | 8 KB | ############################################################################ | 100% setuptools-52.0.0 | 936 KB | ############################################################################ | 100% wheel-0.36.2 | 31 KB | ############################################################################ | 100% vs2015_runtime-14.27 | 2.2 MB | ############################################################################ | 100% ca-certificates-2021 | 150 KB | ############################################################################ | 100% sqlite-3.35.4 | 1.2 MB | ############################################################################ | 100% pip-21.0.1 | 2.0 MB | ############################################################################ | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate tf_2021 # # To deactivate an active environment, use # # $ conda deactivate (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3>
pip install tensorflow
(base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3> (base) E:Anaconda3>conda activate tf_2021 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>pip install tensorflow==1.14.0 Collecting tensorflow==1.14.0 Downloading tensorflow-1.14.0-cp37-cp37m-win_amd64.whl (68.3 MB) |████████████████████████████████| 68.3 MB 226 kB/s Collecting keras-applications>=1.0.6 Using cached Keras_Applications-1.0.8-py3-none-any.whl (50 kB) Collecting keras-preprocessing>=1.0.5 Using cached Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB) Collecting grpcio>=1.8.6 Downloading grpcio-1.37.0-cp37-cp37m-win_amd64.whl (3.1 MB) |████████████████████████████████| 3.1 MB 3.2 MB/s Collecting tensorboard<1.15.0,>=1.14.0 Using cached tensorboard-1.14.0-py3-none-any.whl (3.1 MB) Collecting termcolor>=1.1.0 Using cached termcolor-1.1.0.tar.gz (3.9 kB) Collecting wrapt>=1.11.1 Using cached wrapt-1.12.1.tar.gz (27 kB) Collecting gast>=0.2.0 Using cached gast-0.4.0-py3-none-any.whl (9.8 kB) Requirement already satisfied: wheel>=0.26 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from tensorflow==1.14.0) (0.36.2) Collecting protobuf>=3.6.1 Downloading protobuf-3.15.8-cp37-cp37m-win_amd64.whl (904 kB) |████████████████████████████████| 904 kB 3.3 MB/s Collecting tensorflow-estimator<1.15.0rc0,>=1.14.0rc0 Using cached tensorflow_estimator-1.14.0-py2.py3-none-any.whl (488 kB) Collecting google-pasta>=0.1.6 Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB) Collecting astor>=0.6.0 Using cached astor-0.8.1-py2.py3-none-any.whl (27 kB) Collecting absl-py>=0.7.0 Downloading absl_py-0.12.0-py3-none-any.whl (129 kB) |████████████████████████████████| 129 kB 3.3 MB/s Collecting numpy<2.0,>=1.14.5 Downloading numpy-1.20.2-cp37-cp37m-win_amd64.whl (13.6 MB) |████████████████████████████████| 13.6 MB 3.3 MB/s Collecting six>=1.10.0 Using cached six-1.15.0-py2.py3-none-any.whl (10 kB) Collecting h5py Downloading h5py-3.2.1-cp37-cp37m-win_amd64.whl (2.7 MB) |████████████████████████████████| 2.7 MB 6.8 MB/s Collecting markdown>=2.6.8 Downloading Markdown-3.3.4-py3-none-any.whl (97 kB) |████████████████████████████████| 97 kB 2.3 MB/s Collecting werkzeug>=0.11.15 Using cached Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB) Requirement already satisfied: setuptools>=41.0.0 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0) (52.0.0.post20210125) Collecting importlib-metadata Downloading importlib_metadata-3.10.1-py3-none-any.whl (14 kB) Collecting cached-property Using cached cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB) Collecting typing-extensions>=3.6.4 Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB) Collecting zipp>=0.5 Downloading zipp-3.4.1-py3-none-any.whl (5.2 kB) Building wheels for collected packages: termcolor, wrapt Building wheel for termcolor (setup.py) ... done Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4829 sha256=dc9f1840022adc2c25de6f10bce75748a914c5c35f58719a0532623520772036 Stored in directory: c:userszztappdatalocalpipcachewheels3fe3ec8a8336ff196023622fbcb36de0c5a5c218cbb24111d1d4c7f2 Building wheel for wrapt (setup.py) ... done Created wheel for wrapt: filename=wrapt-1.12.1-py3-none-any.whl size=19553 sha256=f0cd5e6773786874b563aa1a7c3394a35e7c8561b54cc47fc00730df91614fd6 Stored in directory: c:userszztappdatalocalpipcachewheels62764caa25851149f3f6d9785f6c869387ad82b3fd37582fa8147ac6 Successfully built termcolor wrapt Installing collected packages: zipp, typing-extensions, six, numpy, importlib-metadata, cached-property, werkzeug, protobuf, markdown, h5py, grpcio, absl-py, wrapt, termcolor, tensorflow-estimator, tensorboard, keras-preprocessing, keras-applications, google-pasta, gast, astor, tensorflow Successfully installed absl-py-0.12.0 astor-0.8.1 cached-property-1.5.2 gast-0.4.0 google-pasta-0.2.0 grpcio-1.37.0 h5py-3.2.1 importlib-metadata-3.10.1 keras-applications-1.0.8 keras-preprocessing-1.1.2 markdown-3.3.4 numpy-1.20.2 protobuf-3.15.8 six-1.15.0 tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0 termcolor-1.1.0 typing-extensions-3.7.4.3 werkzeug-1.0.1 wrapt-1.12.1 zipp-3.4.1 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>
(tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>pip install protobuf-compiler Collecting protobuf-compiler Downloading protobuf_compiler-1.0.20-py3-none-any.whl (8.6 kB) Collecting grpcio==1.18.0 Downloading grpcio-1.18.0-cp37-cp37m-win_amd64.whl (1.5 MB) |████████████████████████████████| 1.5 MB 969 kB/s Collecting tqdm==4.31.1 Downloading tqdm-4.31.1-py2.py3-none-any.whl (48 kB) |████████████████████████████████| 48 kB 3.2 MB/s Collecting colorama==0.3.3 Downloading colorama-0.3.3.tar.gz (22 kB) Requirement already satisfied: termcolor==1.1.0 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from protobuf-compiler) (1.1.0) Collecting grpcio-tools==1.18.0 Downloading grpcio_tools-1.18.0-cp37-cp37m-win_amd64.whl (1.4 MB) |████████████████████████████████| 1.4 MB 3.3 MB/s Collecting bleach==2.1.0 Downloading bleach-2.1-py2.py3-none-any.whl (27 kB) Collecting html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre Downloading html5lib-1.1-py2.py3-none-any.whl (112 kB) |████████████████████████████████| 112 kB 6.4 MB/s Requirement already satisfied: six in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from bleach==2.1.0->protobuf-compiler) (1.15.0) Requirement already satisfied: protobuf>=3.5.0.post1 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from grpcio-tools==1.18.0->protobuf-compiler) (3.15.8) Collecting webencodings Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB) Building wheels for collected packages: colorama Building wheel for colorama (setup.py) ... done Created wheel for colorama: filename=colorama-0.3.3-py3-none-any.whl size=14317 sha256=29a89e5fdcf429238588b8b43c07db66e23ab858a22d49640fd553e436bf30c9 Stored in directory: c:userszztappdatalocalpipcachewheelsac429777eb85865f435ca81a91fe4c269471f5b4d50144344868f3b1 Successfully built colorama Installing collected packages: webencodings, html5lib, grpcio, tqdm, grpcio-tools, colorama, bleach, protobuf-compiler Attempting uninstall: grpcio Found existing installation: grpcio 1.37.0 Uninstalling grpcio-1.37.0: Successfully uninstalled grpcio-1.37.0 Successfully installed bleach-2.1 colorama-0.3.3 grpcio-1.18.0 grpcio-tools-1.18.0 html5lib-1.1 protobuf-compiler-1.0.20 tqdm-4.31.1 webencodings-0.5.1 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>
(tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>pip install Cython Collecting Cython Downloading Cython-0.29.23-cp37-cp37m-win_amd64.whl (1.6 MB) |████████████████████████████████| 1.6 MB 297 kB/s Installing collected packages: Cython Successfully installed Cython-0.29.23 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>
(tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>pip install contextlib2 Collecting contextlib2 Downloading contextlib2-0.6.0.post1-py2.py3-none-any.whl (9.8 kB) Installing collected packages: contextlib2 Successfully installed contextlib2-0.6.0.post1 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>
(tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>pip install pillow Collecting pillow Downloading Pillow-8.2.0-cp37-cp37m-win_amd64.whl (2.2 MB) |████████████████████████████████| 2.2 MB 297 kB/s Installing collected packages: pillow Successfully installed pillow-8.2.0 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>
(tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>pip install lxml Collecting lxml Downloading lxml-4.6.3-cp37-cp37m-win_amd64.whl (3.5 MB) |████████████████████████████████| 3.5 MB 3.3 MB/s Installing collected packages: lxml Successfully installed lxml-4.6.3 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>
(tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>pip install jupyter Collecting jupyter Downloading jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB) Collecting ipykernel Downloading ipykernel-5.5.3-py3-none-any.whl (120 kB) |████████████████████████████████| 120 kB 284 kB/s Collecting jupyter-console Downloading jupyter_console-6.4.0-py3-none-any.whl (22 kB) Collecting nbconvert Downloading nbconvert-6.0.7-py3-none-any.whl (552 kB) |████████████████████████████████| 552 kB 1.3 MB/s Collecting qtconsole Downloading qtconsole-5.0.3-py3-none-any.whl (119 kB) |████████████████████████████████| 119 kB 6.4 MB/s Collecting ipywidgets Downloading ipywidgets-7.6.3-py2.py3-none-any.whl (121 kB) |████████████████████████████████| 121 kB 3.3 MB/s Collecting notebook Downloading notebook-6.3.0-py3-none-any.whl (9.5 MB) |████████████████████████████████| 9.5 MB 3.3 MB/s Collecting jupyter-client Downloading jupyter_client-6.1.12-py3-none-any.whl (112 kB) |████████████████████████████████| 112 kB 6.4 MB/s Collecting tornado>=4.2 Downloading tornado-6.1-cp37-cp37m-win_amd64.whl (422 kB) |████████████████████████████████| 422 kB 3.2 MB/s Collecting ipython>=5.0.0 Downloading ipython-7.22.0-py3-none-any.whl (785 kB) |████████████████████████████████| 785 kB 6.8 MB/s Collecting traitlets>=4.1.0 Downloading traitlets-5.0.5-py3-none-any.whl (100 kB) |████████████████████████████████| 100 kB 6.4 MB/s Collecting pickleshare Downloading pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB) Collecting decorator Downloading decorator-5.0.7-py3-none-any.whl (8.8 kB) Requirement already satisfied: colorama in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from ipython>=5.0.0->ipykernel->jupyter) (0.3.3) Collecting jedi>=0.16 Downloading jedi-0.18.0-py2.py3-none-any.whl (1.4 MB) |████████████████████████████████| 1.4 MB 3.3 MB/s Requirement already satisfied: setuptools>=18.5 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from ipython>=5.0.0->ipykernel->jupyter) (52.0.0.post20210125) Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 Downloading prompt_toolkit-3.0.18-py3-none-any.whl (367 kB) |████████████████████████████████| 367 kB 6.8 MB/s Collecting backcall Downloading backcall-0.2.0-py2.py3-none-any.whl (11 kB) Collecting pygments Downloading Pygments-2.8.1-py3-none-any.whl (983 kB) |████████████████████████████████| 983 kB 6.4 MB/s Collecting parso<0.9.0,>=0.8.0 Downloading parso-0.8.2-py2.py3-none-any.whl (94 kB) |████████████████████████████████| 94 kB 1.0 MB/s Collecting wcwidth Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB) Collecting ipython-genutils Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB) Collecting widgetsnbextension~=3.5.0 Downloading widgetsnbextension-3.5.1-py2.py3-none-any.whl (2.2 MB) |████████████████████████████████| 2.2 MB 6.4 MB/s Collecting nbformat>=4.2.0 Downloading nbformat-5.1.3-py3-none-any.whl (178 kB) |████████████████████████████████| 178 kB 3.3 MB/s Collecting jupyterlab-widgets>=1.0.0 Downloading jupyterlab_widgets-1.0.0-py3-none-any.whl (243 kB) |████████████████████████████████| 243 kB 6.4 MB/s Collecting jsonschema!=2.5.0,>=2.4 Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB) |████████████████████████████████| 56 kB 2.0 MB/s Collecting jupyter-core Downloading jupyter_core-4.7.1-py3-none-any.whl (82 kB) |████████████████████████████████| 82 kB 482 kB/s Requirement already satisfied: importlib-metadata in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter) (3.10.1) Collecting attrs>=17.4.0 Downloading attrs-20.3.0-py2.py3-none-any.whl (49 kB) |████████████████████████████████| 49 kB 3.2 MB/s Requirement already satisfied: six>=1.11.0 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter) (1.15.0) Collecting pyrsistent>=0.14.0 Downloading pyrsistent-0.17.3.tar.gz (106 kB) |████████████████████████████████| 106 kB 6.4 MB/s Collecting prometheus-client Downloading prometheus_client-0.10.1-py2.py3-none-any.whl (55 kB) |████████████████████████████████| 55 kB 4.1 MB/s Collecting Send2Trash>=1.5.0 Downloading Send2Trash-1.5.0-py3-none-any.whl (12 kB) Collecting terminado>=0.8.3 Downloading terminado-0.9.4-py3-none-any.whl (14 kB) Collecting pyzmq>=17 Downloading pyzmq-22.0.3-cp37-cp37m-win_amd64.whl (1.2 MB) |████████████████████████████████| 1.2 MB 6.4 MB/s Collecting jinja2 Downloading Jinja2-2.11.3-py2.py3-none-any.whl (125 kB) |████████████████████████████████| 125 kB 6.8 MB/s Collecting argon2-cffi Downloading argon2_cffi-20.1.0-cp37-cp37m-win_amd64.whl (42 kB) |████████████████████████████████| 42 kB 363 kB/s Collecting python-dateutil>=2.1 Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB) |████████████████████████████████| 227 kB 6.8 MB/s Collecting pywin32>=1.0 Downloading pywin32-300-cp37-cp37m-win_amd64.whl (9.2 MB) |████████████████████████████████| 9.2 MB 3.2 MB/s Collecting pywinpty>=0.5 Downloading pywinpty-0.5.7-cp37-cp37m-win_amd64.whl (1.3 MB) |████████████████████████████████| 1.3 MB 6.4 MB/s Collecting cffi>=1.0.0 Downloading cffi-1.14.5-cp37-cp37m-win_amd64.whl (178 kB) |████████████████████████████████| 178 kB 3.3 MB/s Collecting pycparser Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB) |████████████████████████████████| 112 kB 6.4 MB/s Requirement already satisfied: typing-extensions>=3.6.4 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from importlib-metadata->jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter) (3.7.4.3) Requirement already satisfied: zipp>=0.5 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from importlib-metadata->jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets->jupyter) (3.4.1) Collecting MarkupSafe>=0.23 Downloading MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl (16 kB) Collecting defusedxml Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB) Collecting mistune<2,>=0.8.1 Downloading mistune-0.8.4-py2.py3-none-any.whl (16 kB) Collecting jupyterlab-pygments Downloading jupyterlab_pygments-0.1.2-py2.py3-none-any.whl (4.6 kB) Collecting testpath Downloading testpath-0.4.4-py2.py3-none-any.whl (163 kB) |████████████████████████████████| 163 kB 6.4 MB/s Collecting nbclient<0.6.0,>=0.5.0 Downloading nbclient-0.5.3-py3-none-any.whl (82 kB) |████████████████████████████████| 82 kB 6.1 MB/s Collecting pandocfilters>=1.4.1 Downloading pandocfilters-1.4.3.tar.gz (16 kB) Collecting entrypoints>=0.2.2 Downloading entrypoints-0.3-py2.py3-none-any.whl (11 kB) Requirement already satisfied: bleach in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from nbconvert->jupyter) (2.1) Collecting async-generator Downloading async_generator-1.10-py3-none-any.whl (18 kB) Collecting nest-asyncio Downloading nest_asyncio-1.5.1-py3-none-any.whl (5.0 kB) Requirement already satisfied: html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from bleach->nbconvert->jupyter) (1.1) Requirement already satisfied: webencodings in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre->bleach->nbconvert->jupyter) (0.5.1) Collecting qtpy Downloading QtPy-1.9.0-py2.py3-none-any.whl (54 kB) |████████████████████████████████| 54 kB 1.1 MB/s Building wheels for collected packages: pyrsistent, pandocfilters Building wheel for pyrsistent (setup.py) ... done Created wheel for pyrsistent: filename=pyrsistent-0.17.3-cp37-cp37m-win_amd64.whl size=55871 sha256=ca43d3b92456d91bd189bad6e48f27eef7908cee0572d03154a591933a4d9702 Stored in directory: c:userszztappdatalocalpipcachewheelsa552f71258a1d7b3c8cbe1ee53f9314c6f65f20385481eaee573cc5 Building wheel for pandocfilters (setup.py) ... done Created wheel for pandocfilters: filename=pandocfilters-1.4.3-py3-none-any.whl size=7992 sha256=9033ec8aa079b66ed1671e688b32a7d50ca91af50deb2c21ac27d3b170592227 Stored in directory: c:userszztappdatalocalpipcachewheels428134545dc2fbf0e9137811e901108d37fc04650e81d48f97078000 Successfully built pyrsistent pandocfilters Installing collected packages: ipython-genutils, traitlets, pywin32, pyrsistent, attrs, wcwidth, tornado, pyzmq, python-dateutil, parso, jupyter-core, jsonschema, pygments, pycparser, prompt-toolkit, pickleshare, nest-asyncio, nbformat, MarkupSafe, jupyter-client, jedi, decorator, backcall, async-generator, testpath, pywinpty, pandocfilters, nbclient, mistune, jupyterlab-pygments, jinja2, ipython, entrypoints, defusedxml, cffi, terminado, Send2Trash, prometheus-client, nbconvert, ipykernel, argon2-cffi, notebook, widgetsnbextension, qtpy, jupyterlab-widgets, qtconsole, jupyter-console, ipywidgets, jupyter Successfully installed MarkupSafe-1.1.1 Send2Trash-1.5.0 argon2-cffi-20.1.0 async-generator-1.10 attrs-20.3.0 backcall-0.2.0 cffi-1.14.5 decorator-5.0.7 defusedxml-0.7.1 entrypoints-0.3 ipykernel-5.5.3 ipython-7.22.0 ipython-genutils-0.2.0 ipywidgets-7.6.3 jedi-0.18.0 jinja2-2.11.3 jsonschema-3.2.0 jupyter-1.0.0 jupyter-client-6.1.12 jupyter-console-6.4.0 jupyter-core-4.7.1 jupyterlab-pygments-0.1.2 jupyterlab-widgets-1.0.0 mistune-0.8.4 nbclient-0.5.3 nbconvert-6.0.7 nbformat-5.1.3 nest-asyncio-1.5.1 notebook-6.3.0 pandocfilters-1.4.3 parso-0.8.2 pickleshare-0.7.5 prometheus-client-0.10.1 prompt-toolkit-3.0.18 pycparser-2.20 pygments-2.8.1 pyrsistent-0.17.3 python-dateutil-2.8.1 pywin32-300 pywinpty-0.5.7 pyzmq-22.0.3 qtconsole-5.0.3 qtpy-1.9.0 terminado-0.9.4 testpath-0.4.4 tornado-6.1 traitlets-5.0.5 wcwidth-0.2.5 widgetsnbextension-3.5.1 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>
(tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>pip install matplotlib Collecting matplotlib Downloading matplotlib-3.4.1-cp37-cp37m-win_amd64.whl (7.1 MB) |████████████████████████████████| 7.1 MB 3.3 MB/s Requirement already satisfied: pillow>=6.2.0 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from matplotlib) (8.2.0) Collecting pyparsing>=2.2.1 Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB) |████████████████████████████████| 67 kB 2.8 MB/s Requirement already satisfied: python-dateutil>=2.7 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from matplotlib) (2.8.1) Collecting cycler>=0.10 Downloading cycler-0.10.0-py2.py3-none-any.whl (6.5 kB) Requirement already satisfied: numpy>=1.16 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from matplotlib) (1.20.2) Collecting kiwisolver>=1.0.1 Downloading kiwisolver-1.3.1-cp37-cp37m-win_amd64.whl (51 kB) |████████████████████████████████| 51 kB 3.8 MB/s Requirement already satisfied: six in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from cycler>=0.10->matplotlib) (1.15.0) Installing collected packages: pyparsing, kiwisolver, cycler, matplotlib Successfully installed cycler-0.10.0 kiwisolver-1.3.1 matplotlib-3.4.1 pyparsing-2.4.7 (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3> (tf_2021) E:Anaconda3>
(tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>pip install opencv-python Collecting opencv-python Downloading opencv_python-4.5.1.48-cp37-cp37m-win_amd64.whl (34.9 MB) |████████████████████████████████| 34.9 MB 3.2 MB/s Requirement already satisfied: numpy>=1.14.5 in c:userszztappdatalocalcondacondaenvs f_2021libsite-packages (from opencv-python) (1.20.2) Installing collected packages: opencv-python Successfully installed opencv-python-4.5.1.48 (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>
(tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detection/protos/*.proto python_out=. Missing output directives. (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>for /f %i in ('dir /b object_detectionprotos*.proto') do protoc object_detectionprotos\%i --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosanchor_generator.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosargmax_matcher.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosipartite_matcher.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosox_coder.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosox_predictor.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotoseval.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosfaster_rcnn.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosfaster_rcnn_box_coder.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosgraph_rewriter.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosgrid_anchor_generator.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotoshyperparams.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosimage_resizer.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosinput_reader.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotoskeypoint_box_coder.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotoslosses.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosmatcher.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosmean_stddev_box_coder.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosmodel.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosmultiscale_anchor_generator.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosoptimizer.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotospipeline.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotospost_processing.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotospreprocessor.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotos egion_similarity_calculator.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotossquare_box_coder.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosssd.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosssd_anchor_generator.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotosstring_int_label_map.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch>protoc object_detectionprotos rain.proto --python_out=. (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>
(tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>SET PYTHONPATH=%cd%;%cd%slim (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>
(tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>python object_detectionuildersmodel_builder_test.py C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorflowpythonframeworkdtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorflowpythonframeworkdtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorflowpythonframeworkdtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorflowpythonframeworkdtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorflowpythonframeworkdtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorflowpythonframeworkdtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorboardcompat ensorflow_stubdtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorboardcompat ensorflow_stubdtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorboardcompat ensorflow_stubdtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorboardcompat ensorflow_stubdtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorboardcompat ensorflow_stubdtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorboardcompat ensorflow_stubdtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) WARNING:tensorflow: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see: * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md * https://github.com/tensorflow/addons * https://github.com/tensorflow/io (for I/O related ops) If you depend on functionality not listed there, please file an issue. WARNING:tensorflow:From E:Anaconda3models-1.13.0 esearchslim etsinception_resnet_v2.py:373: The name tf.GraphKeys is deprecated. Please use tf.compat.v1.GraphKeys instead. WARNING:tensorflow:From E:Anaconda3models-1.13.0 esearchslim etsmobilenetmobilenet.py:389: The name tf.nn.avg_pool is deprecated. Please use tf.nn.avg_pool2d instead. Running tests under Python 3.7.10: C:UserszztAppDataLocalcondacondaenvs f_2021python.exe [ RUN ] ModelBuilderTest.test_create_embedded_ssd_mobilenet_v1_model_from_config C:UserszztAppDataLocalcondacondaenvs f_2021libsite-packages ensorflowpythonframework ensor_util.py:538: DeprecationWarning: tostring() is deprecated. Use tobytes() instead. tensor_proto.tensor_content = nparray.tostring() [ OK ] ModelBuilderTest.test_create_embedded_ssd_mobilenet_v1_model_from_config [ RUN ] ModelBuilderTest.test_create_faster_rcnn_inception_resnet_v2_model_from_config WARNING:tensorflow:From E:Anaconda3models-1.13.0 esearchobject_detectionanchor_generatorsgrid_anchor_generator.py:59: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use `tf.cast` instead. W0415 08:32:15.916748 1152 deprecation.py:323] From E:Anaconda3models-1.13.0 esearchobject_detectionanchor_generatorsgrid_anchor_generator.py:59: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use `tf.cast` instead. [ OK ] ModelBuilderTest.test_create_faster_rcnn_inception_resnet_v2_model_from_config [ RUN ] ModelBuilderTest.test_create_faster_rcnn_inception_v2_model_from_config [ OK ] ModelBuilderTest.test_create_faster_rcnn_inception_v2_model_from_config [ RUN ] ModelBuilderTest.test_create_faster_rcnn_model_from_config_with_example_miner [ OK ] ModelBuilderTest.test_create_faster_rcnn_model_from_config_with_example_miner [ RUN ] ModelBuilderTest.test_create_faster_rcnn_nas_model_from_config [ OK ] ModelBuilderTest.test_create_faster_rcnn_nas_model_from_config [ RUN ] ModelBuilderTest.test_create_faster_rcnn_pnas_model_from_config [ OK ] ModelBuilderTest.test_create_faster_rcnn_pnas_model_from_config [ RUN ] ModelBuilderTest.test_create_faster_rcnn_resnet101_with_mask_prediction_enabled0 (use_matmul_crop_and_resize=False) [ OK ] ModelBuilderTest.test_create_faster_rcnn_resnet101_with_mask_prediction_enabled0 (use_matmul_crop_and_resize=False) [ RUN ] ModelBuilderTest.test_create_faster_rcnn_resnet101_with_mask_prediction_enabled1 (use_matmul_crop_and_resize=True) [ OK ] ModelBuilderTest.test_create_faster_rcnn_resnet101_with_mask_prediction_enabled1 (use_matmul_crop_and_resize=True) [ RUN ] ModelBuilderTest.test_create_faster_rcnn_resnet_v1_models_from_config [ OK ] ModelBuilderTest.test_create_faster_rcnn_resnet_v1_models_from_config [ RUN ] ModelBuilderTest.test_create_rfcn_resnet_v1_model_from_config [ OK ] ModelBuilderTest.test_create_rfcn_resnet_v1_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_inception_v2_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_inception_v2_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_inception_v3_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_inception_v3_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_mobilenet_v1_fpn_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_mobilenet_v1_fpn_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_mobilenet_v1_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_mobilenet_v1_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_mobilenet_v1_ppn_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_mobilenet_v1_ppn_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_mobilenet_v2_fpn_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_mobilenet_v2_fpn_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_mobilenet_v2_fpnlite_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_mobilenet_v2_fpnlite_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_mobilenet_v2_keras_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_mobilenet_v2_keras_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_mobilenet_v2_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_mobilenet_v2_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_resnet_v1_fpn_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_resnet_v1_fpn_model_from_config [ RUN ] ModelBuilderTest.test_create_ssd_resnet_v1_ppn_model_from_config [ OK ] ModelBuilderTest.test_create_ssd_resnet_v1_ppn_model_from_config [ RUN ] ModelBuilderTest.test_session [ SKIPPED ] ModelBuilderTest.test_session ---------------------------------------------------------------------- Ran 22 tests in 0.078s OK (skipped=1) (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch> (tf_2021) E:Anaconda3models-1.13.0 esearch>
#!/usr/bin/env python # coding: utf-8 # # Object Detection Demo # Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md) before you start. # # Imports # In[ ]: import numpy as np import os import six.moves.urllib as urllib import sys import tarfile import tensorflow as tf import zipfile import cv2 from distutils.version import StrictVersion from collections import defaultdict from io import StringIO from matplotlib import pyplot as plt from PIL import Image # This is needed since the notebook is stored in the object_detection folder. sys.path.append("..") from object_detection.utils import ops as utils_ops if StrictVersion(tf.__version__) < StrictVersion('1.9.0'): raise ImportError('Please upgrade your TensorFlow installation to v1.9.* or later!') # ## Env setup # In[ ]: # This is needed to display the images. #get_ipython().run_line_magic('matplotlib', 'inline') # ## Object detection imports # Here are the imports from the object detection module. # In[ ]: from utils import label_map_util from utils import visualization_utils as vis_util # # Model preparation # ## Variables # # Any model exported using the `export_inference_graph.py` tool can be loaded here simply by changing `PATH_TO_FROZEN_GRAPH` to point to a new .pb file. # # By default we use an "SSD with Mobilenet" model here. See the [detection model zoo](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md) for a list of other models that can be run out-of-the-box with varying speeds and accuracies. # In[ ]: # What model to download. MODEL_NAME = 'ssd_mobilenet_v1_coco_2017_11_17' MODEL_FILE = MODEL_NAME + '.tar.gz' DOWNLOAD_BASE = 'http://download.tensorflow.org/models/object_detection/' # Path to frozen detection graph. This is the actual model that is used for the object detection. PATH_TO_FROZEN_GRAPH = MODEL_NAME + '/frozen_inference_graph.pb' # List of the strings that is used to add correct label for each box. PATH_TO_LABELS = os.path.join('data', 'mscoco_label_map.pbtxt') # ## Download Model # In[ ]: opener = urllib.request.URLopener() opener.retrieve(DOWNLOAD_BASE + MODEL_FILE, MODEL_FILE) tar_file = tarfile.open(MODEL_FILE) for file in tar_file.getmembers(): file_name = os.path.basename(file.name) if 'frozen_inference_graph.pb' in file_name: tar_file.extract(file, os.getcwd()) # ## Load a (frozen) Tensorflow model into memory. # In[ ]: detection_graph = tf.Graph() with detection_graph.as_default(): od_graph_def = tf.GraphDef() with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid: serialized_graph = fid.read() od_graph_def.ParseFromString(serialized_graph) tf.import_graph_def(od_graph_def, name='') # ## Loading label map # Label maps map indices to category names, so that when our convolution network predicts `5`, we know that this corresponds to `airplane`. Here we use internal utility functions, but anything that returns a dictionary mapping integers to appropriate string labels would be fine # In[ ]: category_index = label_map_util.create_category_index_from_labelmap(PATH_TO_LABELS, use_display_name=True) # ## Helper code # In[ ]: def load_image_into_numpy_array(image): (im_width, im_height) = image.size return np.array(image.getdata()).reshape( (im_height, im_width, 3)).astype(np.uint8) # # Detection # In[ ]: # For the sake of simplicity we will use only 2 images: # image1.jpg # image2.jpg # If you want to test the code with your images, just add path to the images to the TEST_IMAGE_PATHS. PATH_TO_TEST_IMAGES_DIR = 'test_images' PATH_TO_OUT_TEST_IMAGES_DIR = 'test_images_out' TEST_IMAGE_PATHS = [ os.path.join(PATH_TO_TEST_IMAGES_DIR, 'image{}.jpg'.format(i)) for i in range(1, 3) ] # Size, in inches, of the output images. IMAGE_SIZE = (12, 8) # In[ ]: def run_inference_for_single_image(image, graph): with graph.as_default(): with tf.Session() as sess: # Get handles to input and output tensors ops = tf.get_default_graph().get_operations() all_tensor_names = {output.name for op in ops for output in op.outputs} tensor_dict = {} for key in [ 'num_detections', 'detection_boxes', 'detection_scores', 'detection_classes', 'detection_masks' ]: tensor_name = key + ':0' if tensor_name in all_tensor_names: tensor_dict[key] = tf.get_default_graph().get_tensor_by_name( tensor_name) if 'detection_masks' in tensor_dict: # The following processing is only for single image detection_boxes = tf.squeeze(tensor_dict['detection_boxes'], [0]) detection_masks = tf.squeeze(tensor_dict['detection_masks'], [0]) # Reframe is required to translate mask from box coordinates to image coordinates and fit the image size. real_num_detection = tf.cast(tensor_dict['num_detections'][0], tf.int32) detection_boxes = tf.slice(detection_boxes, [0, 0], [real_num_detection, -1]) detection_masks = tf.slice(detection_masks, [0, 0, 0], [real_num_detection, -1, -1]) detection_masks_reframed = utils_ops.reframe_box_masks_to_image_masks( detection_masks, detection_boxes, image.shape[0], image.shape[1]) detection_masks_reframed = tf.cast( tf.greater(detection_masks_reframed, 0.5), tf.uint8) # Follow the convention by adding back the batch dimension tensor_dict['detection_masks'] = tf.expand_dims( detection_masks_reframed, 0) image_tensor = tf.get_default_graph().get_tensor_by_name('image_tensor:0') # Run inference output_dict = sess.run(tensor_dict, feed_dict={image_tensor: np.expand_dims(image, 0)}) # all outputs are float32 numpy arrays, so convert types as appropriate output_dict['num_detections'] = int(output_dict['num_detections'][0]) output_dict['detection_classes'] = output_dict[ 'detection_classes'][0].astype(np.uint8) output_dict['detection_boxes'] = output_dict['detection_boxes'][0] output_dict['detection_scores'] = output_dict['detection_scores'][0] if 'detection_masks' in output_dict: output_dict['detection_masks'] = output_dict['detection_masks'][0] return output_dict # In[ ]: for image_path in TEST_IMAGE_PATHS: image = Image.open(image_path) # the array based representation of the image will be used later in order to prepare the # result image with boxes and labels on it. image_np = load_image_into_numpy_array(image) # Expand dimensions since the model expects images to have shape: [1, None, None, 3] image_np_expanded = np.expand_dims(image_np, axis=0) # Actual detection. output_dict = run_inference_for_single_image(image_np, detection_graph) # Visualization of the results of a detection. vis_util.visualize_boxes_and_labels_on_image_array( image_np, output_dict['detection_boxes'], output_dict['detection_classes'], output_dict['detection_scores'], category_index, instance_masks=output_dict.get('detection_masks'), use_normalized_coordinates=True, line_thickness=8) #plt.figure(figsize=IMAGE_SIZE) #plt.imshow(image_np) #OUT_TEST_IMAGE_PATHS = [ os.path.join(PATH_TO_OUT_TEST_IMAGES_DIR, 'image{}.jpg'.format(i)) for i in range(1, 3) ] image_path_out = image_path.replace("test_images","test_images_out") print(image_path_out) cv2.imwrite(image_path_out,image_np) # In[ ]:
安装 labelme
(wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018>pip install labelme Collecting labelme Downloading labelme-4.5.7.tar.gz (1.5 MB) |████████████████████████████████| 1.5 MB 1.3 MB/s Collecting imgviz>=0.11.0 Downloading imgviz-1.2.6.tar.gz (7.7 MB) |████████████████████████████████| 7.7 MB 1.7 MB/s Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Collecting matplotlib<3.3 Downloading matplotlib-3.2.2-cp37-cp37m-win_amd64.whl (9.2 MB) |████████████████████████████████| 9.2 MB 6.8 MB/s Requirement already satisfied: numpy in e:anaconda3installenvswind_202104libsite-packages (from labelme) (1.20.2) Requirement already satisfied: Pillow>=2.8.0 in c:usersimappdata oamingpythonpython37site-packages (from labelme) (8.2.0) Requirement already satisfied: PyYAML in e:anaconda3installenvswind_202104libsite-packages (from labelme) (5.4.1) Requirement already satisfied: qtpy in c:usersimappdata oamingpythonpython37site-packages (from labelme) (1.9.0) Requirement already satisfied: termcolor in e:anaconda3installenvswind_202104libsite-packages (from labelme) (1.1.0) Collecting PyQt5 Downloading PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl (6.8 MB) |████████████████████████████████| 6.8 MB 2.2 MB/s Requirement already satisfied: colorama in e:anaconda3installenvswind_202104libsite-packages (from labelme) (0.3.3) Requirement already satisfied: cycler>=0.10 in c:usersimappdata oamingpythonpython37site-packages (from matplotlib<3.3->labelme) (0.10.0) Requirement already satisfied: python-dateutil>=2.1 in c:usersimappdata oamingpythonpython37site-packages (from matplotlib<3.3->labelme) (2.8.1) Requirement already satisfied: kiwisolver>=1.0.1 in c:usersimappdata oamingpythonpython37site-packages (from matplotlib<3.3->labelme) (1.3.1) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:usersimappdata oamingpythonpython37site-packages (from matplotlib<3.3->labelme) (2.4.7) Requirement already satisfied: six in e:anaconda3installenvswind_202104libsite-packages (from cycler>=0.10->matplotlib<3.3->labelme) (1.15.0) Collecting PyQt5-Qt5>=5.15 Downloading PyQt5_Qt5-5.15.2-py3-none-win_amd64.whl (50.1 MB) |████████████████████████████████| 50.1 MB 99 kB/s Collecting PyQt5-sip<13,>=12.8 Downloading PyQt5_sip-12.8.1-cp37-cp37m-win_amd64.whl (62 kB) |████████████████████████████████| 62 kB 138 kB/s Building wheels for collected packages: labelme, imgviz Building wheel for labelme (setup.py) ... done Created wheel for labelme: filename=labelme-4.5.7-py3-none-any.whl size=1464688 sha256=60187add8acd7a5d1ccf80309ee30594778e0ba32dcdd826d9f5b7c5f2108fcd Stored in directory: c:usersimappdatalocalpipcachewheels207458c8c6dacbe2504c3cf738ca1d4587fdb4885792548d4f7b1eba Building wheel for imgviz (PEP 517) ... done Created wheel for imgviz: filename=imgviz-1.2.6-py3-none-any.whl size=7674073 sha256=dacec8048dea70d7f87993720662bfe60696f7496922128b6d918dd20ea8af92 Stored in directory: c:usersimappdatalocalpipcachewheelse664f9a28eca2133ece5f072f51282577f2f9b7d6d0492eb3d2104dd Successfully built labelme imgviz Installing collected packages: PyQt5-sip, PyQt5-Qt5, matplotlib, PyQt5, imgviz, labelme Attempting uninstall: matplotlib Found existing installation: matplotlib 3.4.1 Uninstalling matplotlib-3.4.1: Successfully uninstalled matplotlib-3.4.1 Successfully installed PyQt5-5.15.4 PyQt5-Qt5-5.15.2 PyQt5-sip-12.8.1 imgviz-1.2.6 labelme-4.5.7 matplotlib-3.2.2 (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018> (wind_202104) F:TensorflowProjectmaks_rcnn_2018>
https://blog.csdn.net/zhangzc12409/article/details/90512044
https://github.com/tensorflow/models/blob/v1.13.0/research/object_detection/g3doc/installation.md
https://github.com/tensorflow/models/blob/v1.13.0/research/object_detection/g3doc/installation.md
############################