{"id":412607,"date":"2024-06-29T22:39:13","date_gmt":"2024-06-29T22:39:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=412607"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=412607","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u0430\u043a \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u0443\u044e CNN \u0441\u0435\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tensorflow, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tensoflow-lite \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c android.<br \/>  \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0430\u0432\u0442\u043e\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u043f\u0440\u0435\u0442\u0435\u043d\u0437\u0438\u0439 \u043d\u0430 \u0432\u0441\u0435\u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/v9\/rz\/yn\/v9rzynqqbpveh1aoktj9bj4bu1s.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/v9\/rz\/yn\/v9rzynqqbpveh1aoktj9bj4bu1s.jpeg\" data-blurred=\"true\"\/><\/div>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0434\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438.<\/h3>\n<p>  \u0414\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0438\u0436\u0435:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import tensorflow as tf import numpy as np from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense  model = Sequential([Dense(units=1, input_shape=[1])]) model.compile(optimizer='sgd', loss='mean_squared_error')  xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0], dtype=float) ys = np.array([-3.0, -1.0, 1.0, 3.0, 5.0, 7.0], dtype=float)  model.fit(xs, ys, epochs=500) print(model.predict([10.0])) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u0434\u0443. \u041f\u043e\u0441\u043b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 tensorflow,numpy \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043b\u043e\u0439 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043d\u0435\u0439\u0440\u043e\u043d. <\/p>\n<p>  \u0421\u0430\u043c\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0434\u0432\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445:<\/p>\n<pre><code class=\"python\">X = \u20131, 0, 1, 2, 3, 4 Y = \u20133, \u20131, 1, 3, 5, 7 <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u00ab\u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f\u00bb \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 Y = 2X \u2013 1. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e Y \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u0440\u043e\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0435\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c sgd \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043f\u043e\u0442\u0435\u0440\u044c mean_squared_error.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 500 \u044d\u043f\u043e\u0445<br \/>  (model.fit(xs, ys, epochs=500).<\/p>\n<p>  <i>*\u041d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043d\u0430 \u0436\u0435\u043b\u0435\u0437\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0435\u0435 \u043b\u0438\u0431\u043e \u0432 Google colab \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0442\u0430\u043a \u043a\u0430\u043a 500 \u044d\u043f\u043e\u0445 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u0434\u043e 2-3 \u0447\u0430\u0441\u043e\u0432 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. <\/i><\/p>\n<p>  \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u043f\u043e\u0434\u0430\u0447\u0438 \u0435\u0439 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0447\u0438\u0441\u043b\u0430 10.0. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Y \u043f\u0440\u0438 X=10.0. \u0412 \u0438\u0434\u0435\u0430\u043b\u0435, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435, Y \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c 19.0. \u041d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0441\u043b\u043e, \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u0435 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043a 19.0. <\/p>\n<p>  \u0422\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c. \u0418\u043c\u0435\u043d\u043d\u043e \u0435\u0435 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 android \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e.<\/p>\n<h3>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438.<\/h3>\n<p>  \u0414\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f tensorflow-lite. \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 tensorflow-lite \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0435\u0431\u044f \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442, \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0446\u0435\u043b\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u0443\u044e \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0442\u0438, \u0447\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043f\u0430\u0434\u0435\u043d\u0438\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u043c\u0435\u0436\u0434\u0443 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0438 \u0435\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435. \u0412\u0442\u043e\u0440\u0430\u044f \u0446\u0435\u043b\u044c \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c, \u0432\u043a\u043b\u044e\u0447\u0430\u044f android, ios, \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b. <\/p>\n<p>  \u0412\u0430\u0436\u043d\u043e\u0439 \u0447\u0435\u0440\u0442\u043e\u0439 tensorflow-lite \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0441 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c. \u041d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tensorflow \u0438 \u0434\u0430\u043b\u0435\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 tensorflow-lite.<\/p>\n<p>  \u0417\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e?<\/p>\n<p>  \u0412\u043e\u043f\u0440\u043e\u0441 \u0440\u0438\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439, \u043d\u043e \u0438\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u00ab\u0437\u0430\u00bb \u2014 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0439 \u0441\u0432\u044f\u0437\u0438 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u0413\u043e\u0432\u043e\u0440\u044f \u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439 tensorflow-lite \u0444\u043e\u0440\u043c\u0430\u0442, \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u0434\u0443 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430. <\/p>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043f\u0435\u0440\u0432\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c:<\/p>\n<pre><code class=\"python\">export_dir = 'model' tf.saved_model.save(model,'model') <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u00abmodel.pb\u00bb. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">converter = tf.lite.TFLiteConverter.from_saved_model(export_dir) tflite_model = converter.convert() <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .tflite \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f pathlib:<\/p>\n<pre><code class=\"python\">import pathlib tflite_model_file = pathlib.Path('model.tflite') tflite_model_file.write_bytes(tflite_model) <\/code><\/pre>\n<p>  \u0413\u043e\u0442\u043e\u0432\u0443\u044e model.tflite \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, android \u0438\u043b\u0438 ios.<\/p>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 tensorflow-lite<\/h2>\n<p>  <\/p>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043d\u0437\u043e\u0440\u043e\u0432<\/h3>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440, \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u0442\u0435\u043d\u0437\u043e\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<pre><code class=\"python\">interpreter = tf.lite.Interpreter(model_content=tflite_model) interpreter.allocate_tensors() <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 tensorflow-lite \u043e\u0442 Tensorflow. \u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c model.predict(\u0447\u0442\u043e-\u0442\u043e) \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0442\u043e \u0432 tensorflow-lite \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u0430\u043c\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0443.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<pre><code class=\"python\">input_details = interpreter.get_input_details() output_details = interpreter.get_output_details() print(input_details) print(output_details) <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<pre><code class=\"python\">[{'name': 'dense_input', 'index': 0,&lt;b> 'shape': array([1, 1]&lt;\/b>, dtype=int32),    'shape_signature': array([1, 1], dtype=int32),  'dtype': class 'numpy.float32', 'quantization': (0.0, 0),  'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32),    'quantized_dimension': 0}, 'sparsity_parameters': {}}] <\/code><\/pre>\n<p>  \u0412 \u0432\u044b\u0432\u043e\u0434\u0435 input_details \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 shape(\u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c) \u2014 \u043c\u0430\u0441\u0441\u0438\u0432 1,1 \u0438 \u043a\u043b\u0430\u0441\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 numpy.float32. \u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c<b> \u0432\u0445\u043e\u0434\u043d\u044b\u0435<\/b> \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442.<br \/>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0430\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c Y \u0434\u043b\u044f X=10.0:<\/p>\n<pre><code class=\"python\">to_predict = np.array([[10.0]], dtype=np.float32) print(to_predict) <\/code><\/pre>\n<p>  \u0412 \u0432\u044b\u0432\u043e\u0434\u0435 output_details \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0445\u043e\u0436, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 [[y]], \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 [[x]]:<\/p>\n<pre><code class=\"python\">[{'name': 'Identity', 'index': 3, 'shape': array([1, 1], dtype=int32),    'shape_signature': array([1, 1], dtype=int32), 'dtype': &lt;class    'numpy.float32'>, 'quantization': (0.0, 0), 'quantization_parameters':    {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32),    'quantized_dimension': 0}, 'sparsity_parameters': {}}] <\/code><\/pre>\n<p>  <\/p>\n<h3>\u041f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043d\u0437\u043e\u0440 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">interpreter.set_tensor(input_details[0]['index'], to_predict) interpreter.invoke() <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432\u0432\u043e\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e input_details[0], \u043a \u043d\u0435\u043c\u0443 \u043c\u044b \u0438 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u0435.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 invoke.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u043c \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 get_tensor:<\/p>\n<pre><code class=\"python\">tflite_results = interpreter.get_tensor(output_details[0]['index']) print(tflite_results) <\/code><\/pre>\n<p>  \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043d\u0437\u043e\u0440, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a output_details[0].<\/p>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">to_predict = np.array([[10.0]], dtype=np.float32) print(to_predict) interpreter.set_tensor(input_details[0]['index'], to_predict) interpreter.invoke() tflite_results = interpreter.get_tensor(output_details[0]['index']) print(tflite_results) <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"python\">[[10.]] [[18.975412]] <\/code><\/pre>\n<p>  \u0413\u0434\u0435 10 \u2014 \u044d\u0442\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 X, \u0430 18.97 \u2014 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430, \u0431\u043b\u0438\u0437\u043a\u0430\u044f \u043a 19 (\u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0442\u0430 \u0436\u0435 Y=2X \u2013 1).<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 android \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e (\u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d)<\/h3>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0438 \u0435\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 tensorflow-lite,<br \/>  \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Android.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f IDE &#8212;<a href=\"https:\/\/developer.android.com\/studio\" rel=\"nofollow noopener noreferrer\"> Android Studio<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u043e\u0441\u043e\u0431\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f. <\/p>\n<p>  \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Android Studio \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0441 \u044d\u0442\u0438\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u043c\u0430\u043d\u0443\u0430\u043b\u0430\u043c. \u042f\u0437\u044b\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 Kotlin.<\/p>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u043e \u043d\u0430 android \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432\u044b\u0448\u0435 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443. \u041f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0425 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c Y, \u0432\u044b\u0432\u043e\u0434\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Android Studio<\/h3>\n<p>  \u0426\u0435\u043f\u043e\u0447\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Android Studio \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<p>  <i>File \u2192 New \u2192 New Project\u2192 Empty Activity<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zq\/at\/ca\/zqatcarqwutiqso9biaqbuoafb8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zq\/at\/ca\/zqatcarqwutiqso9biaqbuoafb8.png\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043e\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0435 \u0437\u0430\u0431\u044b\u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u2014 Kotlin:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/22\/wy\/se\/22wysemp73czxrk7etxw2uwkjnm.png\" data-src=\"https:\/\/habrastorage.org\/webt\/22\/wy\/se\/22wysemp73czxrk7etxw2uwkjnm.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f Finish, Android Studio \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/xf\/ip\/yo\/xfipyosmnssktgtssyuvfhlc56a.png\" data-src=\"https:\/\/habrastorage.org\/webt\/xf\/ip\/yo\/xfipyosmnssktgtssyuvfhlc56a.png\"\/><br \/>  <i>*\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0434\u0438\u0437\u0430\u0439\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0430\u0447\u0435.<\/i><\/p>\n<p>  <b>\u041f\u0440\u0430\u0432\u0438\u043c activity_main.xml<\/b>:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rx\/mk\/qr\/rxmkqrcxuhb62dgmiyxfreoq_sc.png\" data-src=\"https:\/\/habrastorage.org\/webt\/rx\/mk\/qr\/rxmkqrcxuhb62dgmiyxfreoq_sc.png\"\/><\/p>\n<p>  \u0417\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0430 <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;LinearLayout xmlns:tools=\"http:\/\/schemas.android.com\/tools\"     android:orientation=\"vertical\"     xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"     android:layout_height=\"match_parent\"     android:layout_width=\"match_parent\">      &lt;LinearLayout         android:layout_width=\"match_parent\"         android:layout_height=\"wrap_content\">          &lt;TextView             android:id=\"@+id\/lblEnter\"             android:layout_width=\"wrap_content\"             android:layout_height=\"wrap_content\"             android:text=\"Enter X:  \"             android:textSize=\"18sp\">&lt;\/TextView>          &lt;EditText             android:id=\"@+id\/txtValue\"             android:layout_width=\"180dp\"             android:layout_height=\"wrap_content\"             android:inputType=\"number\"             android:text=\"1\">&lt;\/EditText>          &lt;Button             android:id=\"@+id\/convertButton\"             android:layout_width=\"wrap_content\"             android:layout_height=\"wrap_content\"             android:text=\"Convert\">         &lt;\/Button>     &lt;\/LinearLayout> &lt;\/LinearLayout> <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u042d\u0442\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <b>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 Tensorflow lite<\/b><\/p>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b build.gradle \u0444\u0430\u0439\u043b\u044b. \u0418\u0445 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u0432\u0430, \u0438 \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 app \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 app:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/uw\/ng\/et\/uwnget0ptfqu05_ywjdmnurjze8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/uw\/ng\/et\/uwnget0ptfqu05_ywjdmnurjze8.png\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ew\/9n\/s-\/ew9ns-kzrobc5zm8weytvwoa2qm.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ew\/9n\/s-\/ew9ns-kzrobc5zm8weytvwoa2qm.png\"\/><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0432 \u043a\u043e\u043d\u0446\u0435, \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c tensorflow lite \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430 \u041f\u041a. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u00ab\u0434\u0440\u0435\u0432\u043d\u0438\u0439\u00bb tensorflow 1.9.0, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u044d\u0442\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u2014 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ot\/bm\/wz\/otbmwz7ponis9yxyvv6vnyzoyuy.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ot\/bm\/wz\/otbmwz7ponis9yxyvv6vnyzoyuy.png\"\/><br \/>  *<i>\u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e tensorflow lite? \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432 cmd \u2014 pip freeze \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e tensorflow \u043b\u0438\u0431\u043e \u0447\u0435\u0440\u0435\u0437 idle python \u2014 import tensorflow as tf; print(tf.__version__) .<\/i><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/nz\/s8\/7p\/nzs87pneav4jy-dnjyuoagv-fok.png\" data-src=\"https:\/\/habrastorage.org\/webt\/nz\/s8\/7p\/nzs87pneav4jy-dnjyuoagv-fok.png\"\/><\/p>\n<p>  \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0444\u0430\u0439\u043b build.gradle \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"kotlin\">plugins {     id 'com.android.application'     id 'kotlin-android' }  android {     compileSdkVersion 30     buildToolsVersion \"30.0.3\"      defaultConfig {         applicationId \"com.example.firsttflite\"         minSdkVersion 23         targetSdkVersion 30         versionCode 1         versionName \"1.0\"          testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"     }      buildTypes {         release {             minifyEnabled false             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'         }     }     compileOptions {         sourceCompatibility JavaVersion.VERSION_1_8         targetCompatibility JavaVersion.VERSION_1_8     }     kotlinOptions {         jvmTarget = '1.8'     }     aaptOptions {         noCompress \"tflite\"     } }  dependencies {     implementation 'org.tensorflow:tensorflow-lite:1.9.0'     implementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version\"     implementation 'androidx.core:core-ktx:1.3.1'     implementation 'androidx.appcompat:appcompat:1.2.0'     implementation 'com.google.android.material:material:1.3.0'     implementation 'androidx.constraintlayout:constraintlayout:2.0.1'     testImplementation 'junit:junit:4.+'     androidTestImplementation 'androidx.test.ext:junit:1.1.2'     androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' } <\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h3>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0430\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 tf-lite<\/h3>\n<p>  \u0412 \u043f\u0430\u043f\u043a\u0435 main \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 assets \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u0442\u0443\u0434\u0430 \u0440\u0430\u043d\u0435\u0435 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u2014 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ft\/ru\/q3\/ftruq3atbxq8_4dy0rezu9ak5hg.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ft\/ru\/q3\/ftruq3atbxq8_4dy0rezu9ak5hg.png\"\/><\/p>\n<h3>\u041f\u0440\u0438\u0432\u044f\u0436\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u043a android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e<\/h3>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b MainActivity.kt:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/vy\/sk\/pk\/vyskpkll7ynymw1ieg4umwywsf4.png\" data-src=\"https:\/\/habrastorage.org\/webt\/vy\/sk\/pk\/vyskpkll7ynymw1ieg4umwywsf4.png\"\/><\/p>\n<p>  \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u0432 \u043d\u0435\u0433\u043e <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"kotlin\">package com.example.firsttflite   import android.app.AlertDialog import android.content.DialogInterface import android.content.res.AssetManager import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.Button import android.widget.EditText import org.tensorflow.lite.Interpreter import java.io.FileInputStream import java.lang.Exception import java.nio.ByteBuffer import java.nio.ByteOrder import java.nio.MappedByteBuffer import java.nio.channels.FileChannel  class MainActivity : AppCompatActivity() {     private lateinit var tflite : Interpreter     private lateinit var tflitemodel : ByteBuffer     private lateinit var txtValue : EditText     override fun onCreate(savedInstanceState: Bundle?) {         super.onCreate(savedInstanceState)         setContentView(R.layout.activity_main)         try{             tflitemodel = loadModelFile(this.assets, \"model.tflite\")             tflite = Interpreter(tflitemodel)         } catch(ex: Exception){             ex.printStackTrace()         }          var convertButton: Button = findViewById&lt;Button>(R.id.convertButton)         convertButton.setOnClickListener{             doInference()         }          txtValue = findViewById&lt;EditText>(R.id.txtValue)     }      private fun loadModelFile(assetManager: AssetManager, modelPath: String): ByteBuffer {         val fileDescriptor = assetManager.openFd(modelPath)         val inputStream = FileInputStream(fileDescriptor.fileDescriptor)         val fileChannel = inputStream.channel         val startOffset = fileDescriptor.startOffset         val declaredLength = fileDescriptor.declaredLength         return fileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, declaredLength)     }      private fun doInference(){         var userVal: Float = txtValue.text.toString().toFloat()         var inputVal: FloatArray = floatArrayOf(userVal)         var outputVal: ByteBuffer = ByteBuffer.allocateDirect(4)         outputVal.order(ByteOrder.nativeOrder())         tflite.run(inputVal, outputVal)         outputVal.rewind()         var f:Float = outputVal.getFloat()         val builder = AlertDialog.Builder(this)          with(builder)         {             setTitle(\"TFLite Interpreter\")             setMessage(\"Your Value is:$f\")             setNeutralButton(\"OK\", DialogInterface.OnClickListener {                     dialog, id -> dialog.cancel()             })             show()         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Run &#8216;app&#8217;<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zk\/rw\/ao\/zkrwaoxt-pqbwy30i_nrsj_xa9u.png\" data-src=\"https:\/\/habrastorage.org\/webt\/zk\/rw\/ao\/zkrwaoxt-pqbwy30i_nrsj_xa9u.png\"\/><\/p>\n<p>  \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0432 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435 android \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/fg\/qi\/lv\/fgqilvqyu09xahpcuzqvapvcvas.png\" data-src=\"https:\/\/habrastorage.org\/webt\/fg\/qi\/lv\/fgqilvqyu09xahpcuzqvapvcvas.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 X, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0430\u0441\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Y, \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u0435 \u043a \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435 Y=2X-1, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c .apk \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d<\/h3>\n<p>  \u0412\u044b\u0431\u0435\u0440\u0435\u043c Build ->Build bundle.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ow\/fe\/xq\/owfexqgxympwxrcpsvbb0wbfduc.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ow\/fe\/xq\/owfexqgxympwxrcpsvbb0wbfduc.png\"\/><\/p>\n<p>  Android Studio \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c .apk, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0438\u0437 ~\\app\\build\\outputs\\apk\\debug \u0438, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u043a \u041f\u041a, \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0432\u0438\u0434 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/bm\/rw\/cw\/bmrwcwlbezesvpcd1evy8rzuxqk.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/bm\/rw\/cw\/bmrwcwlbezesvpcd1evy8rzuxqk.jpeg\" data-blurred=\"true\"\/>  <\/div>\n<\/p><\/div>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0432\u0441\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0436\u0438\u0432\u0435\u0442 \u043d\u0430 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0435, \u0437\u0430\u043d\u0438\u043c\u0430\u044f \u0432\u0441\u0435\u0433\u043e 10\u041c\u0431.<\/p>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\u043d\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u2014 <a href=\"https:\/\/disk.yandex.ru\/d\/lBrK5enjvAQ4Xg\" rel=\"nofollow noopener noreferrer\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c<\/a><\/li>\n<li>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 tf-lite \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u2014 <a href=\"https:\/\/disk.yandex.ru\/d\/rusUzcYbw-BeNQ\" rel=\"nofollow noopener noreferrer\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c<\/a><\/li>\n<li>apk \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f android \u2014 <a href=\"https:\/\/disk.yandex.ru\/d\/zEkIuZceC64UZg\" rel=\"nofollow noopener noreferrer\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c<\/a><\/li>\n<\/ul>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e:<\/p>\n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/478578\/\">\u041a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u043a\u0430\u043f\u0447\u0443 \u0413\u0443\u0433\u043b<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/545660\/\">\u041a\u0430\u043a \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043a \u0441\u0430\u0439\u0442\u0443 \u043f\u043e-\u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/464337\/\">\u041a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u043a\u0430\u043f\u0447\u0443: \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043d\u0430 Tensorflow,Keras,python v \u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f \u0437\u0430\u0448\u0443\u043c\u043b\u0435\u043d\u043d\u0430\u044f \u043a\u0430\u043f\u0447\u0430<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/570052\/\"> https:\/\/habr.com\/ru\/articles\/570052\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u0430\u043a \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u0443\u044e CNN \u0441\u0435\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tensorflow, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tensoflow-lite \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c android.<br \/>  \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0430\u0432\u0442\u043e\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u043f\u0440\u0435\u0442\u0435\u043d\u0437\u0438\u0439 \u043d\u0430 \u0432\u0441\u0435\u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/v9\/rz\/yn\/v9rzynqqbpveh1aoktj9bj4bu1s.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/v9\/rz\/yn\/v9rzynqqbpveh1aoktj9bj4bu1s.jpeg\" data-blurred=\"true\"\/><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-412607","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/412607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=412607"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/412607\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=412607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=412607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=412607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}