Changes between Version 13 and Version 14 of misc/setup_for_ML


Ignore:
Timestamp:
05/11/23 16:45:39 (14 months ago)
Author:
obina
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • misc/setup_for_ML

    v13 v14  
    210210obina@notepc:~/work/Python-3.10.11$ make -j8 # 並列化の数はCPU数に応じて適当に 
    211211.... 
    212 obina@notepc:~/work/Python-3.10.11$ make install 
     212obina@notepc:~/work/Python-3.10.11$ make install  # 先に make test するのが正しい姿... 
    213213.... 
    214214}}} 
     
    237237Package    Version 
    238238---------- ------- 
    239 pip        22.3.1 
     239pip        23.0.1 
    240240setuptools 65.5.0 
    241241 
    242 [notice] A new release of pip available: 22.3.1 -> 23.1.2 
     242[notice] A new release of pip is available: 23.0.1 -> 23.1.2 
    243243[notice] To update, run: pip3 install --upgrade pip 
    244244}}} 
     
    247247{{{ 
    248248obina@notepc:~$ pip3 install --upgrade pip 
    249 Requirement already satisfied: pip in /opt/python/3.10.11/lib/python3.10.11/site-packages (22.3.1) 
     249Requirement already satisfied: pip in /opt/python/3.10.11/lib/python3.10/site-packages (23.0.1) 
    250250Collecting pip 
    251251  Downloading pip-23.1.2-py3-none-any.whl (2.1 MB) 
    252      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 1.8 MB/s eta 0:00:00 
     252     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 24.4 MB/s eta 0:00:00 
    253253Installing collected packages: pip 
    254254  Attempting uninstall: pip 
    255     Found existing installation: pip 22.3.1 
    256     Uninstalling pip-22.3.1: 
    257       Successfully uninstalled pip-22.3.1 
     255    Found existing installation: pip 23.0.1 
     256    Uninstalling pip-23.0.1: 
     257      Successfully uninstalled pip-23.0.1 
     258Successfully installed pip-23.1.222.3.1 
    258259Successfully installed pip-23.1.2 
    259260}}} 
     
    325326 
    326327== !TensorFlow インストール == 
    327 例によって(念のため)使うpip確認しておく 
     328例によって(念のため)使うpipの在処を確認しておく 
    328329{{{ 
    329330obina@notepc:~$ source ~/.venv/tf2.12/bin/activate    # venv環境を開始 
     
    382383 
    383384model.fit(x_train, y_train, epochs=5) 
    384 model.evaluate(x_test, y_test) 
    385385}}} 
    386386 
     
    396396次に、利便性のためにipythonやjupyter notebookを入れておく; 依存関係もあるがまとめてnotebookを入れるのが簡単。詳しくは 
    397397https://jupyter.org/install 
    398 を参照。 
    399 {{{ 
    400 (tf2.12) obina@notepc:~$ pip3 install notebook 
     398を参照。あわせて matplotlib も入れておく 
     399{{{ 
     400(tf2.12) obina@notepc:~$ pip3 install notebook matplotlib 
    401401.... 
    402402(tf2.12) obina@notepc:~$ which ipython3 
     
    407407In [1]: 
    408408}}} 
    409 問題なし。 
    410  
    411 ノートブックの起動。デフォルトではOS内のブラウザを立ち上がようとしてしまうので、--no-browserオプションを付けて起動し、Windows側のブラウザで接続する。 
     409ipythonが起動するので問題なし。 
     410 
     411Jupyterノートブックの起動。デフォルトではOS内のブラウザを立ち上がようとしてしまうので、--no-browserオプションを付けて起動し、Windows側のブラウザで接続する。 
    412412{{{ 
    413413(tf2.12) obina@notepc:~$ jupyter notebook --no-browser 
     
    444444[[Image(wsl_python_notebook1.png, 30%)]] 
    445445 
     446このとき入力したコマンドは 
     447{{{ 
     448import numpy as np 
     449import matplotlib.pyplot as plt 
     450 
     451x = np.linspace(-5,5) 
     452y = x**3 
     453 
     454plt.plot(x, y, 'bo-') 
     455plt.grid(True) 
     456}}} 
     457 
    446458※ Notebook 7 なるものがあるとは知らなかった.... 
    447459 
    448 上のコマンドではmatplotlibが入らなかったので、手動で入れた。 
    449 {{{ 
    450 (tf2.12) obina@notepc:~$ pip install matplotlib 
    451 }}} 
    452  
    453 参考のため、pip list 確認(pip freeze 結果ファイルはこちら) 
    454 {{{ 
    455 (tf2.12) obina@notepc:~$ pip list 
    456 Package                      Version 
    457 ---------------------------- -------- 
    458 absl-py                      1.4.0 
    459 anyio                        3.6.2 
    460 argon2-cffi                  21.3.0 
    461 argon2-cffi-bindings         21.2.0 
    462 arrow                        1.2.3 
    463 asttokens                    2.2.1 
    464 astunparse                   1.6.3 
    465 attrs                        23.1.0 
    466 backcall                     0.2.0 
    467 beautifulsoup4               4.12.2 
    468 bleach                       6.0.0 
    469 cachetools                   5.3.0 
    470 certifi                      2023.5.7 
    471 cffi                         1.15.1 
    472 charset-normalizer           3.1.0 
    473 comm                         0.1.3 
    474 contourpy                    1.0.7 
    475 cycler                       0.11.0 
    476 debugpy                      1.6.7 
    477 decorator                    5.1.1 
    478 defusedxml                   0.7.1 
    479 executing                    1.2.0 
    480 fastjsonschema               2.16.3 
    481 flatbuffers                  23.3.3 
    482 fonttools                    4.39.3 
    483 fqdn                         1.5.1 
    484 gast                         0.4.0 
    485 google-auth                  2.17.3 
    486 google-auth-oauthlib         1.0.0 
    487 google-pasta                 0.2.0 
    488 grpcio                       1.54.0 
    489 h5py                         3.8.0 
    490 idna                         3.4 
    491 ipykernel                    6.23.0 
    492 ipython                      8.13.2 
    493 ipython-genutils             0.2.0 
    494 isoduration                  20.11.0 
    495 jax                          0.4.8 
    496 jedi                         0.18.2 
    497 Jinja2                       3.1.2 
    498 jsonpointer                  2.3 
    499 jsonschema                   4.17.3 
    500 jupyter_client               8.2.0 
    501 jupyter_core                 5.3.0 
    502 jupyter-events               0.6.3 
    503 jupyter_server               2.5.0 
    504 jupyter_server_terminals     0.4.4 
    505 jupyterlab-pygments          0.2.2 
    506 keras                        2.12.0 
    507 kiwisolver                   1.4.4 
    508 libclang                     16.0.0 
    509 Markdown                     3.4.3 
    510 MarkupSafe                   2.1.2 
    511 matplotlib                   3.7.1 
    512 matplotlib-inline            0.1.6 
    513 mistune                      2.0.5 
    514 ml-dtypes                    0.1.0 
    515 nbclassic                    1.0.0 
    516 nbclient                     0.7.4 
    517 nbconvert                    7.4.0 
    518 nbformat                     5.8.0 
    519 nest-asyncio                 1.5.6 
    520 notebook                     6.5.4 
    521 notebook_shim                0.2.3 
    522 numpy                        1.23.5 
    523 oauthlib                     3.2.2 
    524 opt-einsum                   3.3.0 
    525 packaging                    23.1 
    526 pandocfilters                1.5.0 
    527 parso                        0.8.3 
    528 pexpect                      4.8.0 
    529 pickleshare                  0.7.5 
    530 Pillow                       9.5.0 
    531 pip                          23.1.2 
    532 platformdirs                 3.5.0 
    533 prometheus-client            0.16.0 
    534 prompt-toolkit               3.0.38 
    535 protobuf                     4.23.0 
    536 psutil                       5.9.5 
    537 ptyprocess                   0.7.0 
    538 pure-eval                    0.2.2 
    539 pyasn1                       0.5.0 
    540 pyasn1-modules               0.3.0 
    541 pycparser                    2.21 
    542 Pygments                     2.15.1 
    543 pyparsing                    3.0.9 
    544 pyrsistent                   0.19.3 
    545 python-dateutil              2.8.2 
    546 python-json-logger           2.0.7 
    547 PyYAML                       6.0 
    548 pyzmq                        25.0.2 
    549 requests                     2.30.0 
    550 requests-oauthlib            1.3.1 
    551 rfc3339-validator            0.1.4 
    552 rfc3986-validator            0.1.1 
    553 rsa                          4.9 
    554 scipy                        1.10.1 
    555 Send2Trash                   1.8.2 
    556 setuptools                   65.5.0 
    557 six                          1.16.0 
    558 sniffio                      1.3.0 
    559 soupsieve                    2.4.1 
    560 stack-data                   0.6.2 
    561 tensorboard                  2.12.3 
    562 tensorboard-data-server      0.7.0 
    563 tensorflow                   2.12.0 
    564 tensorflow-estimator         2.12.0 
    565 tensorflow-io-gcs-filesystem 0.32.0 
    566 termcolor                    2.3.0 
    567 terminado                    0.17.1 
    568 tinycss2                     1.2.1 
    569 tornado                      6.3.1 
    570 traitlets                    5.9.0 
    571 typing_extensions            4.5.0 
    572 uri-template                 1.2.0 
    573 urllib3                      2.0.2 
    574 wcwidth                      0.2.6 
    575 webcolors                    1.13 
    576 webencodings                 0.5.1 
    577 websocket-client             1.5.1 
    578 Werkzeug                     2.3.4 
    579 wheel                        0.40.0 
    580 wrapt                        1.14.1 
    581 }}} 
     460 
    582461 
    583462再掲:venv環境を抜けるのはdeactivate コマンドで終了するか、システムから抜ける。