人工智能-windows环境安装配置部署
下载Anaconda安装成功后
测试是否安装成功conda activate
图片: https://uploader.shimo.im/f/SLKMyM75Ptg9y0GG.png
创建虚拟环境
conda create -n tf1 python3.7
conda activate tf1
conda deactivate tf1
安装opencv 不可颠倒
图片: https://uploader.shimo.im/f/j1LVKSFOqMwSzCRD.png
pip install opencv-python3.4.2.16 -i “https://pypi.doubanio.com/simple/”
pip install opencv-contrib-python==3.4.2.16 -i “https://pypi.doubanio.com/simple/”
测试opencv
图片: https://uploader.shimo.im/f/5mtIxBAoxDAlHJra.png
安装 tensorflow 首先需要先安装cuda cudnn
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ tensorflow-gpu1.14
测试tensorflow
图片: https://uploader.shimo.im/f/E82ibieSOY4fm5M4.png
安装cpu版本的
pip install tensorflow1.14 -i https://pypi.douban.com/simple
打开notebook
jupyter notebook
图片: https://uploader.shimo.im/f/Yj8tbDMCUAM8bW6h.png
done
(tf1) C:\Users\86176>conda list
packages in environment at D:\ProgramData\Anaconda3\envs\tf1:
Name Version Build Channel
_py-xgboost-mutex 2.0 cpu_0
attrs 19.3.0 py_0
backcall 0.1.0 py37_0
blas 1.0 mkl
bleach 3.1.0 py37_0
ca-certificates 2020.1.1 0
certifi 2019.11.28 py37_1
colorama 0.4.3 py_0
cycler 0.10.0 py37_0
decorator 4.4.2 py_0
defusedxml 0.6.0 py_0
entrypoints 0.3 py37_0
freetype 2.9.1 ha9979f8_1
icc_rt 2019.0.0 h0cc432a_1
icu 58.2 ha66f8fd_1
importlib_metadata 1.5.0 py37_0
intel-openmp 2020.0 166
ipykernel 5.1.4 py37h39e3cac_0
ipython 7.13.0 py37h5ca1d4c_0
ipython_genutils 0.2.0 py37_0
ipywidgets 7.5.1 py_0
jedi 0.16.0 py37_1
jinja2 2.11.1 py_0
joblib 0.14.1 py_0
jpeg 9b hb83a4c4_2
jsonschema 3.2.0 py37_0
jupyter 1.0.0 py37_7
jupyter_client 6.1.0 py_0
jupyter_console 6.1.0 py_0
jupyter_core 4.6.1 py37_0
kiwisolver 1.1.0 py37ha925a31_0
libpng 1.6.37 h2a8f88b_0
libsodium 1.0.16 h9d3ae62_0
libxgboost 0.90 1
lightgbm 2.3.0 py37ha925a31_0
m2w64-gcc-libgfortran 5.3.0 6
m2w64-gcc-libs 5.3.0 7
m2w64-gcc-libs-core 5.3.0 7
m2w64-gmp 6.1.0 2
m2w64-libwinpthread-git 5.0.0.4634.697f757 2
markupsafe 1.1.1 py37he774522_0
matplotlib 3.1.3 py37_0
matplotlib-base 3.1.3 py37h64f37c6_0
mistune 0.8.4 py37he774522_0
mkl 2020.0 166
mkl-service 2.3.0 py37hb782905_0
mkl_fft 1.0.15 py37h14836fe_0
mkl_random 1.1.0 py37h675688f_0
msys2-conda-epoch 20160418 1
nbconvert 5.6.1 py37_0
nbformat 5.0.4 py_0
notebook 6.0.3 py37_0
numpy 1.18.1 py37h93ca92e_0
numpy-base 1.18.1 py37hc3f5095_1
openssl 1.1.1e he774522_0
pandas 1.0.3 py37h47e9c7a_0
pandoc 2.2.3.2 0
pandocfilters 1.4.2 py37_1
parso 0.6.2 py_0
pickleshare 0.7.5 py37_0
pip 20.0.2 py37_1
prometheus_client 0.7.1 py_0
prompt_toolkit 3.0.3 py_0
py-xgboost 0.90 py37_1
pygments 2.6.1 py_0
pyparsing 2.4.6 py_0
pyqt 5.9.2 py37h6538335_2
pyrsistent 0.15.7 py37he774522_0
python 3.7.0 hea74fb7_0
python-dateutil 2.8.1 py_0
pytz 2019.3 py_0
pywin32 227 py37he774522_1
pywinpty 0.5.7 py37_0
pyzmq 18.1.1 py37ha925a31_0
qt 5.9.7 vc14h73c81de_0
qtconsole 4.7.2 py_0
qtpy 1.9.0 py_0
scikit-learn 0.22.1 py37h6288b17_0
scipy 1.4.1 py37h9439919_0
seaborn 0.10.0 py_0
send2trash 1.5.0 py37_0
setuptools 46.1.1 py37_0
sip 4.19.8 py37h6538335_0
six 1.14.0 py37_0
sqlite 3.31.1 he774522_0
terminado 0.8.3 py37_0
testpath 0.4.4 py_0
tornado 6.0.4 py37he774522_1
traitlets 4.3.3 py37_0
vc 14.1 h0510ff6_4
vs2015_runtime 14.16.27012 hf0eaf9b_1
wcwidth 0.1.8 py_0
webencodings 0.5.1 py37_1
wheel 0.34.2 py37_0
widgetsnbextension 3.5.1 py37_0
wincertstore 0.2 py37_0
winpty 0.4.3 4
zeromq 4.3.1 h33f27b4_3
zipp 2.2.0 py_0
zlib 1.2.11 h62dcd97_3
(tf1) C:\Users\86176>pip install opencv-python=3.4.2.16 -i “https://pypi.doubanio.com/simple/”
ERROR: Invalid requirement: ‘opencv-python=3.4.2.16’
Hint: = is not a valid operator. Did you mean == ?
(tf1) C:\Users\86176>pip install opencv-python3.4.2.16 -i “https://pypi.doubanio.com/simple/”
Looking in indexes: https://pypi.doubanio.com/simple/
Collecting opencv-python3.4.2.16
Downloading https://pypi.doubanio.com/packages/bd/c9/364f02bb1d2186405995dbb2b579f3c55b68134a9513a7068e0cdbaeb928/opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl (33.8 MB)
|█████████ | 9.6 MB 167 bytes/s eta 1 day, 16:09:57
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
opencv-python==3.4.2.16 from https://pypi.doubanio.com/packages/bd/c9/364f02bb1d2186405995dbb2b579f3c55b68134a9513a7068e0cdbaeb928/opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl#sha256=b0f8c8a17514960318881c539d462eac3c2a8c307e7cf71454bd407ba408f496:
Expected sha256 b0f8c8a17514960318881c539d462eac3c2a8c307e7cf71454bd407ba408f496
Got 1063896d6a28840723fe444a9541090f7b72e270bb526f37899fbc1dd5448d9a
(tf1) C:\Users\86176>
(tf1) C:\Users\86176>
(tf1) C:\Users\86176>pip install opencv-python3.4.2.16 -i “https://pypi.doubanio.com/simple/”
Looking in indexes: https://pypi.doubanio.com/simple/
Collecting opencv-python3.4.2.16
Downloading https://pypi.doubanio.com/packages/bd/c9/364f02bb1d2186405995dbb2b579f3c55b68134a9513a7068e0cdbaeb928/opencv_python-3.4.2.16-cp37-cp37m-win_amd64.whl (33.8 MB)
|████████████████████████████████| 33.8 MB 336 kB/s
Requirement already satisfied: numpy>=1.14.5 in d:\programdata\anaconda3\envs\tf1\lib\site-packages (from opencv-python==3.4.2.16) (1.18.1)
Installing collected packages: opencv-python
Successfully installed opencv-python-3.4.2.16
(tf1) C:\Users\86176>pip install opencv-contrib-python3.4.2.16 -i “https://pypi.doubanio.com/simple/”
Looking in indexes: https://pypi.doubanio.com/simple/
Collecting opencv-contrib-python3.4.2.16
Downloading https://pypi.doubanio.com/packages/a2/1c/778cb8a5f4026d49e299d34a98791599f7485553c29889385c43158b6f43/opencv_contrib_python-3.4.2.16-cp37-cp37m-win_amd64.whl (39.6 MB)
|████████████████████████████████| 39.6 MB 302 kB/s
Requirement already satisfied: numpy>=1.14.5 in d:\programdata\anaconda3\envs\tf1\lib\site-packages (from opencv-contrib-python==3.4.2.16) (1.18.1)
Installing collected packages: opencv-contrib-python
Successfully installed opencv-contrib-python-3.4.2.16
(tf1) C:\Users\86176>conda list
packages in environment at D:\ProgramData\Anaconda3\envs\tf1:
Name Version Build Channel
_py-xgboost-mutex 2.0 cpu_0
attrs 19.3.0 py_0
backcall 0.1.0 py37_0
blas 1.0 mkl
bleach 3.1.0 py37_0
ca-certificates 2020.1.1 0
certifi 2019.11.28 py37_1
colorama 0.4.3 py_0
cycler 0.10.0 py37_0
decorator 4.4.2 py_0
defusedxml 0.6.0 py_0
entrypoints 0.3 py37_0
freetype 2.9.1 ha9979f8_1
icc_rt 2019.0.0 h0cc432a_1
icu 58.2 ha66f8fd_1
importlib_metadata 1.5.0 py37_0
intel-openmp 2020.0 166
ipykernel 5.1.4 py37h39e3cac_0
ipython 7.13.0 py37h5ca1d4c_0
ipython_genutils 0.2.0 py37_0
ipywidgets 7.5.1 py_0
jedi 0.16.0 py37_1
jinja2 2.11.1 py_0
joblib 0.14.1 py_0
jpeg 9b hb83a4c4_2
jsonschema 3.2.0 py37_0
jupyter 1.0.0 py37_7
jupyter_client 6.1.0 py_0
jupyter_console 6.1.0 py_0
jupyter_core 4.6.1 py37_0
kiwisolver 1.1.0 py37ha925a31_0
libpng 1.6.37 h2a8f88b_0
libsodium 1.0.16 h9d3ae62_0
libxgboost 0.90 1
lightgbm 2.3.0 py37ha925a31_0
m2w64-gcc-libgfortran 5.3.0 6
m2w64-gcc-libs 5.3.0 7
m2w64-gcc-libs-core 5.3.0 7
m2w64-gmp 6.1.0 2
m2w64-libwinpthread-git 5.0.0.4634.697f757 2
markupsafe 1.1.1 py37he774522_0
matplotlib 3.1.3 py37_0
matplotlib-base 3.1.3 py37h64f37c6_0
mistune 0.8.4 py37he774522_0
mkl 2020.0 166
mkl-service 2.3.0 py37hb782905_0
mkl_fft 1.0.15 py37h14836fe_0
mkl_random 1.1.0 py37h675688f_0
msys2-conda-epoch 20160418 1
nbconvert 5.6.1 py37_0
nbformat 5.0.4 py_0
notebook 6.0.3 py37_0
numpy 1.18.1 py37h93ca92e_0
numpy-base 1.18.1 py37hc3f5095_1
opencv-contrib-python 3.4.2.16 pypi_0 pypi
opencv-python 3.4.2.16 pypi_0 pypi
openssl 1.1.1e he774522_0
pandas 1.0.3 py37h47e9c7a_0
pandoc 2.2.3.2 0
pandocfilters 1.4.2 py37_1
parso 0.6.2 py_0
pickleshare 0.7.5 py37_0
pip 20.0.2 py37_1
prometheus_client 0.7.1 py_0
prompt_toolkit 3.0.3 py_0
py-xgboost 0.90 py37_1
pygments 2.6.1 py_0
pyparsing 2.4.6 py_0
pyqt 5.9.2 py37h6538335_2
pyrsistent 0.15.7 py37he774522_0
python 3.7.0 hea74fb7_0
python-dateutil 2.8.1 py_0
pytz 2019.3 py_0
pywin32 227 py37he774522_1
pywinpty 0.5.7 py37_0
pyzmq 18.1.1 py37ha925a31_0
qt 5.9.7 vc14h73c81de_0
qtconsole 4.7.2 py_0
qtpy 1.9.0 py_0
scikit-learn 0.22.1 py37h6288b17_0
scipy 1.4.1 py37h9439919_0
seaborn 0.10.0 py_0
send2trash 1.5.0 py37_0
setuptools 46.1.1 py37_0
sip 4.19.8 py37h6538335_0
six 1.14.0 py37_0
sqlite 3.31.1 he774522_0
terminado 0.8.3 py37_0
testpath 0.4.4 py_0
tornado 6.0.4 py37he774522_1
traitlets 4.3.3 py37_0
vc 14.1 h0510ff6_4
vs2015_runtime 14.16.27012 hf0eaf9b_1
wcwidth 0.1.8 py_0
webencodings 0.5.1 py37_1
wheel 0.34.2 py37_0
widgetsnbextension 3.5.1 py37_0
wincertstore 0.2 py37_0
winpty 0.4.3 4
zeromq 4.3.1 h33f27b4_3
zipp 2.2.0 py_0
zlib 1.2.11 h62dcd97_3
(tf1) C:\Users\86176>python
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import cv2
sift=cv2.xfeatures2d.SIFT_create()
exist()
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘exist’ is not definedexit()
(tf1) C:\Users\86176>pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ tensorflow-gpu1.14
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=‘pypi.mirrors.ustc.edu.cn’, port=443): Read timed out. (read timeout=15)”)’: /simple/tensorflow-gpu/
Collecting tensorflow-gpu1.14
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/81/d1/9222b9aac2fa27dccaef38917cde84c24888f3cd0dd139c7e12be9f49a7a/tensorflow_gpu-1.14.0-cp37-cp37m-win_amd64.whl (287.7 MB)
Collecting tensorboard<1.15.0,>=1.14.0
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/91/2d/2ed263449a078cd9c8a9ba50ebd50123adf1f8cfbea1492f9084169b89d9/tensorboard-1.14.0-py3-none-any.whl (3.1 MB)
Processing c:\users\86176\appdata\local\pip\cache\wheels\3c\68\02\0a86bd7e89e3dfa33677c7016bdd2be8ec7a6f2e922fd6dc48\termcolor-1.1.0-cp37-none-any.whl
Processing c:\users\86176\appdata\local\pip\cache\wheels\a5\c0\5b\1ec56f4d3e11c8c33bd3e94880265e968d1e651d75e2dcdc6c\absl_py-0.9.0-cp37-none-any.whl
Collecting astor>=0.6.0
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting protobuf>=3.6.1
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/92/30/1b7ccde09bf0c535d11f18a574ed7d7572c729a8f754fd568b297be08b61/protobuf-3.11.3-cp37-cp37m-win_amd64.whl (1.0 MB)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, ConnectionResetError(10054, ‘远程主机强迫关闭了一个现有的连接。’, None, 10054, None))’: /simple/google-pasta/
Collecting google-pasta>=0.1.6
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57 kB)
|████████████████████████████████| 57 kB 1.3 MB/s
Collecting grpcio>=1.8.6
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a7/6d/99aba8db04bf58193ed157dfe7e848494b93dd8aa3f6a4d1edfef318779c/grpcio-1.27.2-cp37-cp37m-win_amd64.whl (1.9 MB)
Requirement already satisfied: numpy<2.0,>=1.14.5 in d:\programdata\anaconda3\envs\tf1\lib\site-packages (from tensorflow-gpu1.14) (1.18.1)
Collecting wrapt>=1.11.1
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/82/f7/e43cefbe88c5fd371f4cf0cf5eb3feccd07515af9fd6cf7dbf1d1793a797/wrapt-1.12.1.tar.gz (27 kB)
Requirement already satisfied: wheel>=0.26 in d:\programdata\anaconda3\envs\tf1\lib\site-packages (from tensorflow-gpu1.14) (0.34.2)
Collecting keras-applications>=1.0.6
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50 kB)
Collecting keras-preprocessing>=1.0.5
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41 kB)
Requirement already satisfied: six>=1.10.0 in d:\programdata\anaconda3\envs\tf1\lib\site-packages (from tensorflow-gpu1.14) (1.14.0)
Collecting tensorflow-estimator<1.15.0rc0,>=1.14.0rc0
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3c/d5/21860a5b11caf0678fbc8319341b0ae21a07156911132e0e71bffed0510d/tensorflow_estimator-1.14.0-py2.py3-none-any.whl (488 kB)
Collecting gast>=0.2.0
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d6/84/759f5dd23fec8ba71952d97bcc7e2c9d7d63bdc582421f3cd4be845f0c98/gast-0.3.3-py2.py3-none-any.whl (9.7 kB)
Requirement already satisfied: setuptools>=41.0.0 in d:\programdata\anaconda3\envs\tf1\lib\site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow-gpu1.14) (46.1.1.post20200323)
Collecting markdown>=2.6.8
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/ab/c4/ba46d44855e6eb1770a12edace5a165a0c6de13349f592b9036257f3c3d3/Markdown-3.2.1-py2.py3-none-any.whl (88 kB)
Collecting werkzeug>=0.11.15
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/ba/a5/d6f8a6e71f15364d35678a4ec8a0186f980b3bd2545f40ad51dd26a87fb1/Werkzeug-1.0.0-py2.py3-none-any.whl (298 kB)
|████████████████████████████████| 298 kB 48 kB/s
Collecting h5py
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a1/6b/7f62017e3f0b32438dd90bdc1ff0b7b1448b6cb04a1ed84f37b6de95cd7b/h5py-2.10.0-cp37-cp37m-win_amd64.whl (2.5 MB)
|████████████████████████████████| 2.5 MB 226 kB/s
Building wheels for collected packages: wrapt
Building wheel for wrapt (setup.py) … done
Created wheel for wrapt: filename=wrapt-1.12.1-cp37-cp37m-win_amd64.whl size=33370 sha256=7236b20a9b9807f8103d07a59368e586c0e55fc96248a78ace581b955e10ce2b
Stored in directory: c:\users\86176\appdata\local\pip\cache\wheels\81\07\99\f18d0962333f1443672d1a8411017cf5b65fccdebdd4c38eb9
Successfully built wrapt
Installing collected packages: protobuf, grpcio, markdown, absl-py, werkzeug, tensorboard, termcolor, astor, google-pasta, wrapt, h5py, keras-applications, keras-preprocessing, tensorflow-estimator, gast, tensorflow-gpu
Successfully installed absl-py-0.9.0 astor-0.8.1 gast-0.3.3 google-pasta-0.2.0 grpcio-1.27.2 h5py-2.10.0 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.2.1 protobuf-3.11.3 tensorboard-1.14.0 tensorflow-estimator-1.14.0 tensorflow-gpu-1.14.0 termcolor-1.1.0 werkzeug-1.0.0 wrapt-1.12.1
(tf1) C:\Users\86176>python
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import tensorflow as tf
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorflow\python\framework\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorflow\python\framework\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorflow\python\framework\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorflow\python\framework\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorflow\python\framework\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorflow\python\framework\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.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)])
D:\ProgramData\Anaconda3\envs\tf1\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.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)])tf.test.is_gpu_available()
2020-03-27 12:34:52.969250: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-03-27 12:34:52.987159: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll
2020-03-27 12:34:53.662307: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: GeForce MX250 major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:02:00.0
2020-03-27 12:34:53.672988: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-03-27 12:34:53.683580: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2020-03-27 12:34:54.844651: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-03-27 12:34:54.856776: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0
2020-03-27 12:34:54.860651: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N
2020-03-27 12:34:54.871795: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/device:GPU:0 with 1360 MB memory) -> physical GPU (device: 0, name: GeForce MX250, pci bus id: 0000:02:00.0, compute capability: 6.1)
Truegreeting=tf.constant(“ssss”)
sess=tf.Session()
2020-03-27 12:35:33.540705: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: GeForce MX250 major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:02:00.0
2020-03-27 12:35:33.549504: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-03-27 12:35:33.558545: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2020-03-27 12:35:33.564942: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: GeForce MX250 major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:02:00.0
2020-03-27 12:35:33.574063: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-03-27 12:35:33.583296: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2020-03-27 12:35:33.588005: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-03-27 12:35:33.594019: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0
2020-03-27 12:35:33.598294: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N
2020-03-27 12:35:33.693802: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1360 MB memory) -> physical GPU (device: 0, name: GeForce MX250, pci bus id: 0000:02:00.0, compute capability: 6.1)result=sess.run(greeting)
print(result)
b’ssss’sess.close()
情感分析软件
pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install snownlp -i https://pypi.tuna.tsinghua.edu.cn/simple