Tensorflow

Вопросы написания собственного программного кода (на любых языках)

Модератор: Olej

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 02:11

Пора уже про Tensorflow иметь отдельную тему.
Меня (и моих партнёров) в этом смысле интересует детектирование объектов.
(чуть позже наполню эту тему конкретикой)

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 03:04

Olej писал(а):
04 окт 2019, 02:11
детектирование объектов.
Пока интересуют 2 проекта...

1. PSPNet-Keras-tensorflow
Implemented Architecture of Pyramid Scene Parsing Network in Keras.
Изображение

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 03:12

Olej писал(а): Пока интересуют 2 проекта...
2. Tensorflow Object Detection API Tutorial
Hello and welcome to a miniseries and introduction to the TensorFlow Object Detection API. This API can be used to detect, with bounding boxes, objects in images and/or video using either some of the pre-trained models made available or through models you can train on your own (which the API also makes easier).
Изображение

Изображение

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 17:15

Olej писал(а):
04 окт 2019, 03:04
1. PSPNet-Keras-tensorflow
Скачиваем с GIT:

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet$ pwd
/home/olej/2019_WORK/own.WORK/PSPNet

olej@ACER:~/2019_WORK/own.WORK/PSPNet$ git clone https://github.com/Vladkryvoruchko/PSPNet-Keras-tensorflow.git
Клонирование в «PSPNet-Keras-tensorflow»…
remote: Enumerating objects: 65, done.
remote: Counting objects: 100% (65/65), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 623 (delta 31), reused 33 (delta 3), pack-reused 558
Получение объектов: 100% (623/623), 7.20 MiB | 2.93 MiB/s, готово.
Определение изменений: 100% (195/195), готово.

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 17:19

Olej писал(а):
04 окт 2019, 17:15
Olej писал(а):
04 окт 2019, 03:04
1. PSPNet-Keras-tensorflow
Скачиваем с GIT:
Установка требуемых зависимостей (так как они расписывают на GIT):

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pwd
/home/olej/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 install -r requirements.txt --upgrade
ERROR: Invalid requirement: 'opencv-python=4.1.1' (from line 7 of requirements.txt)
Hint: = is not a valid operator. Did you mean == ?
Ошибка!
И - естественно, хотя бы потому, что в 7-й строке (opencv-python) у них = вместо ==:

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ cat requirements.txt 
numpy
scipy==1.3
tensorflow==1.0.0
tensorflow-gpu
keras==2.1.1
imageio==2.5.0
opencv-python=4.1.1
pytest==5.1.3
pytest-xdist==1.29.0
Но я предлагаю устанавливать (или проверять что уже установлено ранее) поштучно из этого списка!

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 17:29

Olej писал(а):
04 окт 2019, 17:19
Но я предлагаю устанавливать (или проверять что уже установлено ранее) поштучно из этого списка!

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 list | grep numpy
gnumpy                  0.2        
numpy                   1.16.1     

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 list | grep scipy
scipy                   1.2.0      

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 list | grep tensorflow-gpu

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 list | grep keras

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 list | grep imageio

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 list | grep opencv-python
opencv-python           4.1.1.26   

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 list | grep pytest
pytest                  3.10.1     

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 list | grep pytest-xdist
Подправил requirements.txt:

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 install -r requirements.txt --upgrade
Collecting numpy (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/ba/e0/46e2f0540370f2661b044647fa447fef2ecbcc8f7cdb4329ca2feb03fb23/numpy-1.17.2-cp37-cp37m-manylinux1_x86_64.whl (20.3MB)
     |████████████████████████████████| 20.3MB 2.8MB/s 
Collecting scipy==1.3 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/5d/bd/c0feba81fb60e231cf40fc8a322ed5873c90ef7711795508692b1481a4ae/scipy-1.3.0-cp37-cp37m-manylinux1_x86_64.whl (25.2MB)
     |████████████████████████████████| 25.2MB 2.7MB/s 
Collecting tensorflow==1.0.0 (from -r requirements.txt (line 3))
  ERROR: Could not find a version that satisfies the requirement tensorflow==1.0.0 (from -r requirements.txt (line 3)) (from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 1.15.0rc0, 1.15.0rc1, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0)
ERROR: No matching distribution found for tensorflow==1.0.0 (from -r requirements.txt (line 3))
tensorflow нет в той версии.
Но зато есть в более свежей:

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 search tensorflow
tensorflow (2.0.0)                           - TensorFlow is an open source machine learning framework for everyone.
...
tensorflow-gpu (2.0.0)                       - TensorFlow is an open source machine learning framework for everyone.
...
Но прежде нужно обновить (иначе ошибка!):

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ sudo pip3 install --upgrade setuptools
[sudo] пароль для olej: 
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/b2/86/095d2f7829badc207c893dd4ac767e871f6cd547145df797ea26baea4e2e/setuptools-41.2.0-py2.py3-none-any.whl (576kB)
     |████████████████████████████████| 583kB 746kB/s 
Installing collected packages: setuptools
  Found existing installation: setuptools 40.8.0
    Uninstalling setuptools-40.8.0:
      Successfully uninstalled setuptools-40.8.0
Successfully installed setuptools-41.2.0

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 install tensorflow 
Collecting tensorflow
  Downloading https://files.pythonhosted.org/packages/2a/5c/f1d66de5dde6f3ff528f6ea1fd0757a0e594d17debb3ec7f82daa967ea9a/tensorflow-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl (86.3MB)
     |████████████████████████████████| 86.3MB 2.3MB/s 
Collecting protobuf>=3.6.1 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/4f/32/ba67677963d9cf557155d5a8f14ae0ffaf278a69a25fb03b5bc9e9e6fd52/protobuf-3.9.2-cp37-cp37m-manylinux1_x86_64.whl (1.2MB)
     |████████████████████████████████| 1.2MB 2.4MB/s 
Requirement already satisfied: numpy<2.0,>=1.16.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (1.16.1)
Collecting grpcio>=1.8.6 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/9e/ef/afc61af08d3c5e58a1ebcc3bb15b9537c515805ebbf0fe80e8ba9f9db38d/grpcio-1.24.0-cp37-cp37m-manylinux1_x86_64.whl (2.3MB)
     |████████████████████████████████| 2.3MB 4.4MB/s 
Collecting wrapt>=1.11.1 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/23/84/323c2415280bc4fc880ac5050dddfb3c8062c2552b34c2e512eb4aa68f79/wrapt-1.11.2.tar.gz
Collecting tensorboard<2.1.0,>=2.0.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/9b/a6/e8ffa4e2ddb216449d34cfcb825ebb38206bee5c4553d69e7bc8bc2c5d64/tensorboard-2.0.0-py3-none-any.whl (3.8MB)
     |████████████████████████████████| 3.8MB 3.9MB/s 
Collecting gast==0.2.2 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz
Collecting google-pasta>=0.1.6 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/d0/33/376510eb8d6246f3c30545f416b2263eee461e40940c2a4413c711bdf62d/google_pasta-0.1.7-py3-none-any.whl (52kB)
     |████████████████████████████████| 61kB 6.0MB/s 
Collecting absl-py>=0.7.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/3c/0d/7cbf64cac3f93617a2b6b079c0182e4a83a3e7a8964d3b0cc3d9758ba002/absl-py-0.8.0.tar.gz (102kB)
     |████████████████████████████████| 112kB 6.5MB/s 
Collecting opt-einsum>=2.3.2 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/b8/83/755bd5324777875e9dff19c2e59daec837d0378c09196634524a3d7269ac/opt_einsum-3.1.0.tar.gz (69kB)
     |████████████████████████████████| 71kB 5.4MB/s 
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (1.11.0)
Collecting tensorflow-estimator<2.1.0,>=2.0.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/95/00/5e6cdf86190a70d7382d320b2b04e4ff0f8191a37d90a422a2f8ff0705bb/tensorflow_estimator-2.0.0-py2.py3-none-any.whl (449kB)
     |████████████████████████████████| 450kB 4.6MB/s 
Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.7/dist-packages (from tensorflow) (0.32.3)
Collecting keras-applications>=1.0.8 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)
     |████████████████████████████████| 51kB 5.7MB/s 
Collecting termcolor>=1.1.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
Collecting keras-preprocessing>=1.0.5 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41kB)
     |████████████████████████████████| 51kB 6.4MB/s 
Collecting astor>=0.6.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/d1/4f/950dfae467b384fc96bc6469de25d832534f6b4441033c39f914efd13418/astor-0.8.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from protobuf>=3.6.1->tensorflow) (40.8.0)
Collecting markdown>=2.6.8 (from tensorboard<2.1.0,>=2.0.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/c0/4e/fd492e91abdc2d2fcb70ef453064d980688762079397f779758e055f6575/Markdown-3.1.1-py2.py3-none-any.whl (87kB)
     |████████████████████████████████| 92kB 5.7MB/s 
Collecting werkzeug>=0.11.15 (from tensorboard<2.1.0,>=2.0.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/ce/42/3aeda98f96e85fd26180534d36570e4d18108d62ae36f87694b476b83d6f/Werkzeug-0.16.0-py2.py3-none-any.whl (327kB)
     |████████████████████████████████| 327kB 4.9MB/s 
Collecting h5py (from keras-applications>=1.0.8->tensorflow)
  Downloading https://files.pythonhosted.org/packages/3f/c0/abde58b837e066bca19a3f7332d9d0493521d7dd6b48248451a9e3fe2214/h5py-2.10.0-cp37-cp37m-manylinux1_x86_64.whl (2.9MB)
     |████████████████████████████████| 2.9MB 4.5MB/s 
Building wheels for collected packages: wrapt, gast, absl-py, opt-einsum, termcolor
  Building wheel for wrapt (setup.py) ... done
...
Successfully built absl-py termcolor wrapt gast opt-einsum
Installing collected packages: absl-py, werkzeug, protobuf, grpcio, markdown, tensorboard, google-pasta, astor, termcolor, wrapt, gast, tensorflow-estimator, keras-preprocessing, h5py, keras-applications, opt-einsum, tensorflow
Successfully installed absl-py-0.8.0 astor-0.8.0 gast-0.2.2 google-pasta-0.1.7 grpcio-1.24.0 h5py-2.10.0 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 opt-einsum-3.1.0 protobuf-3.9.2 tensorboard-2.0.0 tensorflow-2.0.0 tensorflow-estimator-2.0.0 termcolor-1.1.0 werkzeug-0.16.0 wrapt-1.11.2
Это тянет за собой много...

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 17:35

Olej писал(а):
04 окт 2019, 17:29
Это тянет за собой много...
И оставшиеся:

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ sudo pip3 install --upgrade keras
Collecting keras
  Downloading https://files.pythonhosted.org/packages/1b/18/2e1ef121e5560ac24c7ac9e363aa5fa7006c40563c989e7211aba95b793a/Keras-2.3.0-py2.py3-none-any.whl (377kB)
     |████████████████████████████████| 378kB 727kB/s 
Requirement already satisfied, skipping upgrade: scipy>=0.14 in /usr/local/lib/python3.7/dist-packages (from keras) (1.2.0)
Requirement already satisfied, skipping upgrade: keras-applications>=1.0.6 in /usr/local/lib/python3.7/dist-packages (from keras) (1.0.8)
Requirement already satisfied, skipping upgrade: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.7/dist-packages (from keras) (1.1.0)
Requirement already satisfied, skipping upgrade: numpy>=1.9.1 in /usr/local/lib/python3.7/dist-packages (from keras) (1.16.1)
Requirement already satisfied, skipping upgrade: pyyaml in /usr/lib/python3/dist-packages (from keras) (3.13)
Requirement already satisfied, skipping upgrade: h5py in /usr/local/lib/python3.7/dist-packages (from keras) (2.10.0)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in /usr/local/lib/python3.7/dist-packages (from keras) (1.11.0)
Installing collected packages: keras
Successfully installed keras-2.3.0

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ sudo pip3 install --upgrade imageio
Collecting imageio
  Downloading https://files.pythonhosted.org/packages/af/0a/943c965d372dae0b1f1482677d29030ab834351a61a9a632fd62f27f1523/imageio-2.5.0-py3-none-any.whl (3.3MB)
     |████████████████████████████████| 3.3MB 733kB/s 
Requirement already satisfied, skipping upgrade: numpy in /usr/local/lib/python3.7/dist-packages (from imageio) (1.16.1)
Requirement already satisfied, skipping upgrade: pillow in /usr/local/lib/python3.7/dist-packages/Pillow-5.4.0-py3.7-linux-x86_64.egg (from imageio) (5.4.0)
Installing collected packages: imageio
Successfully installed imageio-2.5.0

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ sudo pip3 install --upgrade pytest
Collecting pytest
  Downloading https://files.pythonhosted.org/packages/9a/46/903ea822d83187bb8b354fcb3d085fb10b7787be39f9cf1628bc6ef8f9c9/pytest-5.2.0-py3-none-any.whl (226kB)
     |████████████████████████████████| 235kB 727kB/s 
Requirement already satisfied, skipping upgrade: atomicwrites>=1.0 in /usr/lib/python3/dist-packages (from pytest) (1.1.5)
Requirement already satisfied, skipping upgrade: py>=1.5.0 in /usr/lib/python3/dist-packages (from pytest) (1.7.0)
Requirement already satisfied, skipping upgrade: attrs>=17.4.0 in /usr/lib/python3/dist-packages (from pytest) (18.2.0)
Collecting pluggy<1.0,>=0.12 (from pytest)
  Downloading https://files.pythonhosted.org/packages/92/c7/48439f7d5fd6bddb4c04b850bb862b42e3e2b98570040dfaf68aedd8114b/pluggy-0.13.0-py2.py3-none-any.whl
Collecting importlib-metadata>=0.12; python_version < "3.8" (from pytest)
  Downloading https://files.pythonhosted.org/packages/f6/d2/40b3fa882147719744e6aa50ac39cf7a22a913cbcba86a0371176c425a3b/importlib_metadata-0.23-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: more-itertools>=4.0.0 in /usr/lib/python3/dist-packages (from pytest) (4.2.0)
Collecting wcwidth (from pytest)
  Downloading https://files.pythonhosted.org/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl
Collecting packaging (from pytest)
  Downloading https://files.pythonhosted.org/packages/cf/94/9672c2d4b126e74c4496c6b3c58a8b51d6419267be9e70660ba23374c875/packaging-19.2-py2.py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata>=0.12; python_version < "3.8"->pytest)
  Downloading https://files.pythonhosted.org/packages/74/3d/1ee25a26411ba0401b43c6376d2316a71addcc72ef8690b101b4ea56d76a/zipp-0.6.0-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: six in /usr/local/lib/python3.7/dist-packages (from packaging->pytest) (1.11.0)
Requirement already satisfied, skipping upgrade: pyparsing>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging->pytest) (2.3.0)
Installing collected packages: zipp, importlib-metadata, pluggy, wcwidth, packaging, pytest
  Found existing installation: pluggy 0.8.0
    Uninstalling pluggy-0.8.0:
      Successfully uninstalled pluggy-0.8.0
  Found existing installation: pytest 3.10.1
    Uninstalling pytest-3.10.1:
      Successfully uninstalled pytest-3.10.1
Successfully installed importlib-metadata-0.23 packaging-19.2 pluggy-0.13.0 pytest-5.2.0 wcwidth-0.1.7 zipp-0.6.0

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ sudo pip3 install --upgrade pytest-xdist
Collecting pytest-xdist
  Downloading https://files.pythonhosted.org/packages/9f/cc/371b2e6dfbf4e8df07b04e310dd6ea0b3f367e257d1e6cb516b25bc4af1b/pytest_xdist-1.29.0-py2.py3-none-any.whl
Collecting execnet>=1.1 (from pytest-xdist)
  Downloading https://files.pythonhosted.org/packages/d3/2e/c63af07fa471e0a02d05793c7a56a9f7d274a8489442a5dc4fb3b2b3c705/execnet-1.7.1-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: pytest>=4.4.0 in /usr/local/lib/python3.7/dist-packages (from pytest-xdist) (5.2.0)
Collecting pytest-forked (from pytest-xdist)
  Downloading https://files.pythonhosted.org/packages/3f/55/ef92c340e723495dbee91d749903d2b7950b49c501943296257246d7d880/pytest_forked-1.0.2-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: six in /usr/local/lib/python3.7/dist-packages (from pytest-xdist) (1.11.0)
Collecting apipkg>=1.4 (from execnet>=1.1->pytest-xdist)
  Downloading https://files.pythonhosted.org/packages/67/08/4815a09603fc800209431bec5b8bd2acf2f95abdfb558a44a42507fb94da/apipkg-1.5-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: packaging in /usr/local/lib/python3.7/dist-packages (from pytest>=4.4.0->pytest-xdist) (19.2)
Requirement already satisfied, skipping upgrade: wcwidth in /usr/local/lib/python3.7/dist-packages (from pytest>=4.4.0->pytest-xdist) (0.1.7)
Requirement already satisfied, skipping upgrade: py>=1.5.0 in /usr/lib/python3/dist-packages (from pytest>=4.4.0->pytest-xdist) (1.7.0)
Requirement already satisfied, skipping upgrade: attrs>=17.4.0 in /usr/lib/python3/dist-packages (from pytest>=4.4.0->pytest-xdist) (18.2.0)
Requirement already satisfied, skipping upgrade: importlib-metadata>=0.12; python_version < "3.8" in /usr/local/lib/python3.7/dist-packages (from pytest>=4.4.0->pytest-xdist) (0.23)
Requirement already satisfied, skipping upgrade: more-itertools>=4.0.0 in /usr/lib/python3/dist-packages (from pytest>=4.4.0->pytest-xdist) (4.2.0)
Requirement already satisfied, skipping upgrade: pluggy<1.0,>=0.12 in /usr/local/lib/python3.7/dist-packages (from pytest>=4.4.0->pytest-xdist) (0.13.0)
Requirement already satisfied, skipping upgrade: atomicwrites>=1.0 in /usr/lib/python3/dist-packages (from pytest>=4.4.0->pytest-xdist) (1.1.5)
Requirement already satisfied, skipping upgrade: pyparsing>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging->pytest>=4.4.0->pytest-xdist) (2.3.0)
Requirement already satisfied, skipping upgrade: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=0.12; python_version < "3.8"->pytest>=4.4.0->pytest-xdist) (0.6.0)
Installing collected packages: apipkg, execnet, pytest-forked, pytest-xdist
Successfully installed apipkg-1.5 execnet-1.7.1 pytest-forked-1.0.2 pytest-xdist-1.29.0

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ sudo pip3 install --upgrade tensorflow-gpu
Collecting tensorflow-gpu
  Downloading https://files.pythonhosted.org/packages/a1/eb/bc0784af18f612838f90419cf4805c37c20ddb957f5ffe0c42144562dcfa/tensorflow_gpu-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl (380.8MB)
     |████████████████████████████████| 380.8MB 5.1MB/s 
Requirement already satisfied, skipping upgrade: opt-einsum>=2.3.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (3.1.0)
Requirement already satisfied, skipping upgrade: termcolor>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (1.1.0)
Requirement already satisfied, skipping upgrade: tensorflow-estimator<2.1.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (2.0.0)
Requirement already satisfied, skipping upgrade: absl-py>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (0.8.0)
Requirement already satisfied, skipping upgrade: numpy<2.0,>=1.16.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (1.16.1)
Requirement already satisfied, skipping upgrade: wheel>=0.26 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (0.32.3)
Requirement already satisfied, skipping upgrade: astor>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (0.8.0)
Requirement already satisfied, skipping upgrade: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (1.1.0)
Requirement already satisfied, skipping upgrade: protobuf>=3.6.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (3.9.2)
Requirement already satisfied, skipping upgrade: keras-applications>=1.0.8 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (1.0.8)
Requirement already satisfied, skipping upgrade: google-pasta>=0.1.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (0.1.7)
Requirement already satisfied, skipping upgrade: wrapt>=1.11.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (1.11.2)
Requirement already satisfied, skipping upgrade: grpcio>=1.8.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (1.24.0)
Requirement already satisfied, skipping upgrade: gast==0.2.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (0.2.2)
Requirement already satisfied, skipping upgrade: six>=1.10.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (1.11.0)
Requirement already satisfied, skipping upgrade: tensorboard<2.1.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow-gpu) (2.0.0)
Requirement already satisfied, skipping upgrade: setuptools in /usr/local/lib/python3.7/dist-packages (from protobuf>=3.6.1->tensorflow-gpu) (41.2.0)
Requirement already satisfied, skipping upgrade: h5py in /usr/local/lib/python3.7/dist-packages (from keras-applications>=1.0.8->tensorflow-gpu) (2.10.0)
Requirement already satisfied, skipping upgrade: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow-gpu) (3.1.1)
Requirement already satisfied, skipping upgrade: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow-gpu) (0.16.0)
Installing collected packages: tensorflow-gpu
Successfully installed tensorflow-gpu-2.0.0
Вот теперь ВСЕ Python пакеты, упоминаемые в проекте.

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 17:41

Olej писал(а):
04 окт 2019, 17:35
Вот теперь ВСЕ Python пакеты, упоминаемые в проекте.
Но это - программные проекты, код...
А ещё требуются файлы тренированных весов (результаты обучения), как это сказано в GIT:
Converted trained weights are needed to run the network. Weights(in .h5 .json format) have to be downloaded and placed into directory weights/keras
Already converted weights can be downloaded here:

pspnet50_ade20k.h5 pspnet50_ade20k.json
pspnet101_cityscapes.h5 pspnet101_cityscapes.json
pspnet101_voc2012.h5 pspnet101_voc2012.json
И помещаем всё это, как и было сказано:

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow/weights/keras$ pwd
/home/olej/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow/weights/keras

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow/weights/keras$ ls -l
итого 699840
-rw-r--r-- 1 olej olej 264145248 окт  1 05:47  pspnet101_cityscapes.h5
-rw-r--r-- 1 olej olej    187221 окт  1 05:45  pspnet101_cityscapes.json
-rw-r--r-- 1 olej olej 264149344 окт  1 05:48  pspnet101_voc2012.h5
-rw-r--r-- 1 olej olej    187221 окт  1 05:45  pspnet101_voc2012.json
-rw-r--r-- 1 olej olej 187839752 окт  1 05:46  pspnet50_ade20k.h5
-rw-r--r-- 1 olej olej    104145 окт  1 05:45  pspnet50_ade20k.json
-rw-r--r-- 1 olej olej         0 окт  1 00:02 'Put keras weights here'

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 17:50

Запуск!

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ python3 pspnet.py -m pspnet101_cityscapes -i example_images/cityscapes.png -o example_results/cityscapes.jpg
Using TensorFlow backend.
Недопустимая инструкция
Это что?
А это то, что проект PSPNet собран для вычислений исключительно с применением GPU, технологии CUDA - вычислений на графических процессорах NVIDIA:

Код: Выделить всё

olej@ACER:~/2019_WORK/own.WORK/PSPNet/PSPNet-Keras-tensorflow$ pip3 show tensorflow-gpu
Name: tensorflow-gpu
Version: 2.0.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /usr/local/lib/python3.7/dist-packages
Requires: grpcio, google-pasta, termcolor, keras-applications, absl-py, tensorflow-estimator, wrapt, keras-preprocessing, six, opt-einsum, protobuf, astor, gast, wheel, numpy, tensorboard
Required-by: 
А на этом компьютере у меня нет NVIDIA видеокарты.
Но разбираться с теперешним состоянием с CUDA мы будем (прежде) разбираться в отдельной новой теме: снова CUDA.
И только затем я вернусь к этому проекту на компьютере с NVIDIA.

Аватара пользователя
Olej
Писатель
Сообщения: 12655
Зарегистрирован: 24 сен 2011, 14:22
Откуда: Харьков
Контактная информация:

Re: Tensorflow

Непрочитанное сообщение Olej » 04 окт 2019, 18:32

Olej писал(а):
04 окт 2019, 17:50
Это что?
А это то, что проект PSPNet собран для вычислений исключительно с применением GPU, технологии CUDA - вычислений на графических процессорах NVIDIA:
https://www.tensorflow.org/install/gpu
Note: GPU support is available for Ubuntu and Windows with CUDA®-enabled cards.
TensorFlow GPU support requires an assortment of drivers and libraries. To simplify installation and avoid library conflicts, we recommend
using a TensorFlow Docker image with GPU support (Linux only). This setup only requires the NVIDIA® GPU drivers.

The following GPU-enabled devices are supported:
NVIDIA® GPU card with CUDA® Compute Capability 3.5 or higher. See the list of CUDA-enabled GPU cards.

Software requirements
The following NVIDIA® software must be installed on your system:

NVIDIA® GPU drivers —CUDA 10.0 requires 410.x or higher.
CUDA® Toolkit —TensorFlow supports CUDA 10.0 (TensorFlow >= 1.13.0)
CUPTI ships with the CUDA Toolkit.
cuDNN SDK (>= 7.4.1)
(Optional) TensorRT 5.0 to improve latency and throughput for inference on some models.



For a GPU with CUDA Compute Capability 3.0, or different versions of the NVIDIA libraries, see the Linux build from source guide.

https://www.tensorflow.org/install/source
Build from source

Ответить

Вернуться в «Программирование»

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 4 гостя