Ошибки преобразования модели TensorFlow в TFlite - PullRequest
0 голосов
/ 05 марта 2019

Я пытаюсь преобразовать модель Keras (LSTM) в TFlite для развертывания на Android в 2 этапа.

  1. Чтобы преобразовать Keras в .pb, я использовал код, найденный в этом GitHub repo .
  2. Чтобы конвертировать Pb в .lite, я использую tflite_converter.Он не работает как из сохраненной модели, так и из замороженного графика, в терминале и в Python.

Я настроил код и объединил его с моей моделью:

from sklearn.utils import class_weight
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Dropout
from keras.layers import Flatten
from keras.utils import to_categorical
from keras.optimizers import Adam
from keras import backend as K
from tensorflow.python.framework.graph_util import convert_variables_to_constants
import tensorflow as tf
from tensorflow.python.tools import freeze_graph
from tensorflow.python.tools import optimize_for_inference_lib
import os
import os.path as path

MODEL_NAME = 'pronation_classifier'


def evaluate_model(X_train, labels_train_cat, X_test, labels_test_cat):
    verbose, epochs, batch_size = 1, 50, 64
    n_timesteps, n_features, n_outputs = X_train.shape[1], X_train.shape[2], labels_train_cat.shape[1]

    model = Sequential()
    model.add(LSTM(100, return_sequences=True, input_shape=(n_timesteps,n_features)))
    model.add(LSTM(100, return_sequences=True))
    model.add(LSTM(100))
    model.add(Dropout(0.5))
    model.add(Dense(100, activation='relu'))

    model.add(Dense(n_outputs, activation='softmax'))
    model.compile(Adam(lr=1e-2), loss='categorical_crossentropy', metrics=['accuracy', ])
    model.fit(X_train, labels_train_cat, epochs=epochs, batch_size=batch_size, verbose=verbose, class_weight=class_weights)

    return model

def export_model(saver, model, input_node_names, output_node_name):
    tf.train.write_graph(K.get_session().graph_def, 'out', \
        MODEL_NAME + '_graph.pbtxt')

    saver.save(K.get_session(), 'out/' + MODEL_NAME + '.chkp')

    freeze_graph.freeze_graph('out/' + MODEL_NAME + '_graph.pbtxt', None, \
    False, 'out/' + MODEL_NAME + '.chkp', output_node_name, \
    "save/restore_all", "save/Const:0", \
    'out/frozen_' + MODEL_NAME + '.pb', True, "")

    input_graph_def = tf.GraphDef()
    with tf.gfile.Open('out/frozen_' + MODEL_NAME + '.pb', "rb") as f:
        input_graph_def.ParseFromString(f.read())

    output_graph_def = optimize_for_inference_lib.optimize_for_inference(
        input_graph_def, input_node_names, [output_node_name],
        tf.float32.as_datatype_enum)

    with tf.gfile.FastGFile('out/opt_' + MODEL_NAME + '.pb', "wb") as f:
    f.write(output_graph_def.SerializeToString())

    print("graph saved!")

X_train, X_test, labels_train, labels_test = train_test_split(steps_stack, steps_labels, test_size = 0.2)
labels_train_cat = to_categorical(labels_train)
labels_test_cat = to_categorical(labels_test)
class_weights = class_weight.compute_class_weight('balanced', np.unique(labels_train), labels_train)


model, summary = evaluate_model(X_train, labels_train_cat, X_test, labels_test_cat)
input_node = [node.op.name for node in model.inputs]
output_node = [node.op.name for node in model.outputs]  
session = K.get_session()
min_graph = convert_variables_to_constants(session, session.graph_def, [node.op.name for node in model.outputs])
tf.train.write_graph(min_graph, "~/out/", "file.pb", as_text=True)
export_model(tf.train.Saver(), model, [input_node], output_node)

Всевыше работает (или кажется).

Ошибки: С tfile_converter из GraphDef :

tflite_convert \
>   --graph_def_file=/Users/mila/pronation_classification/out/frozen_pronation_classification.pb \
>   --output_file=/Users/mila/pronation_classification/checkpoint/pronation_classification.lite \
>   --input_format=TENSORFLOW_GRAPHDEF \
>   --output_format=TFLITE \
>   --input_shape=0,30,9 \
>   --input_array=lstm_10_input \
>   --output_array=dense_8/Softmax \
>   --inference_type=FLOAT \
>   --input_data_type=FLOAT
/Users/mila/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2019-03-05 01:16:57.698443: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Traceback (most recent call last):
  File "/Users/mila/anaconda3/bin/tflite_convert", line 11, in <module>
    sys.exit(main())
  File "/Users/mila/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/lite/python/tflite_convert.py", line 412, in main
    app.run(main=run_main, argv=sys.argv[:1])
  File "/Users/mila/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "/Users/mila/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/lite/python/tflite_convert.py", line 408, in run_main
    _convert_model(tflite_flags)
  File "/Users/mila/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/lite/python/tflite_convert.py", line 162, in _convert_model
    output_data = converter.convert()
  File "/Users/mila/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/lite/python/lite.py", line 453, in convert
    **converter_kwargs)
  File "/Users/mila/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 342, in toco_convert_impl
    input_data.SerializeToString())
  File "/Users/mila/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 135, in toco_convert_protos
    (stdout, stderr))
RuntimeError: TOCO failed see console for info.
b'2019-03-05 01:17:10.366148: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayV3\n2019-03-05 01:17:10.366662: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_10/TensorArray\n2019-03-05 01:17:10.366703: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayV3\n2019-03-05 01:17:10.366732: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_10/TensorArray_1\n2019-03-05 01:17:10.366831: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayScatterV3\n2019-03-05 01:17:10.366852: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_10/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n2019-03-05 01:17:10.366886: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.366914: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.366936: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.366956: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.366975: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367025: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367052: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367083: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: LoopCond\n2019-03-05 01:17:10.367095: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_10/while/LoopCond\n2019-03-05 01:17:10.367172: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367189: I tensorflow/contrib/lite/toco/import_tensorflow.cc:189] Unsupported data type in placeholder op: 20\n2019-03-05 01:17:10.367204: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367225: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayReadV3\n2019-03-05 01:17:10.367250: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367285: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367315: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367345: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367373: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367402: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367428: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367453: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367481: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367558: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367637: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367682: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367795: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.367817: I tensorflow/contrib/lite/toco/import_tensorflow.cc:189] Unsupported data type in placeholder op: 20\n2019-03-05 01:17:10.367840: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayWriteV3\n2019-03-05 01:17:10.367856: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_10/while/TensorArrayWrite/TensorArrayWriteV3\n2019-03-05 01:17:10.367897: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Exit\n2019-03-05 01:17:10.367913: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArraySizeV3\n2019-03-05 01:17:10.367925: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_10/TensorArrayStack/TensorArraySizeV3\n2019-03-05 01:17:10.367963: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayGatherV3\n2019-03-05 01:17:10.368468: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayV3\n2019-03-05 01:17:10.368488: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_11/TensorArray\n2019-03-05 01:17:10.368506: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayV3\n2019-03-05 01:17:10.368521: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_11/TensorArray_1\n2019-03-05 01:17:10.368587: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayScatterV3\n2019-03-05 01:17:10.368601: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_11/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n2019-03-05 01:17:10.368629: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368648: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368665: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368682: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368698: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368735: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368758: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368780: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: LoopCond\n2019-03-05 01:17:10.368790: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_11/while/LoopCond\n2019-03-05 01:17:10.368854: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368867: I tensorflow/contrib/lite/toco/import_tensorflow.cc:189] Unsupported data type in placeholder op: 20\n2019-03-05 01:17:10.368880: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368899: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayReadV3\n2019-03-05 01:17:10.368916: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368941: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368965: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.368989: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369013: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369035: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369058: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369080: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369101: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369165: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369231: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369269: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369336: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.369350: I tensorflow/contrib/lite/toco/import_tensorflow.cc:189] Unsupported data type in placeholder op: 20\n2019-03-05 01:17:10.369367: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayWriteV3\n2019-03-05 01:17:10.369380: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_11/while/TensorArrayWrite/TensorArrayWriteV3\n2019-03-05 01:17:10.369420: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Exit\n2019-03-05 01:17:10.369435: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArraySizeV3\n2019-03-05 01:17:10.369446: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_11/TensorArrayStack/TensorArraySizeV3\n2019-03-05 01:17:10.369485: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayGatherV3\n2019-03-05 01:17:10.369961: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayV3\n2019-03-05 01:17:10.369980: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_12/TensorArray\n2019-03-05 01:17:10.369998: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayV3\n2019-03-05 01:17:10.370012: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_12/TensorArray_1\n2019-03-05 01:17:10.370085: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayScatterV3\n2019-03-05 01:17:10.370100: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_12/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3\n2019-03-05 01:17:10.370128: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370149: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370166: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370182: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370199: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370236: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370258: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370281: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: LoopCond\n2019-03-05 01:17:10.370291: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_12/while/LoopCond\n2019-03-05 01:17:10.370353: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370366: I tensorflow/contrib/lite/toco/import_tensorflow.cc:189] Unsupported data type in placeholder op: 20\n2019-03-05 01:17:10.370380: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370398: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayReadV3\n2019-03-05 01:17:10.370415: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370439: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370463: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370487: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370510: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370532: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370555: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370576: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370598: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370660: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370725: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370763: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370830: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: Enter\n2019-03-05 01:17:10.370843: I tensorflow/contrib/lite/toco/import_tensorflow.cc:189] Unsupported data type in placeholder op: 20\n2019-03-05 01:17:10.370859: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported operation: TensorArrayWriteV3\n2019-03-05 01:17:10.370872: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1127] Op node missing output type attribute: lstm_12/while/TensorArrayWrite/TensorArrayWriteV3\n2019-03-05 01:17:10.370910: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1080] Converting unsupported tensorflow --version03-05 01:17:10.370

Суть в том, что онповторяет «Преобразование неподдерживаемой операции» и «Отсутствует операционный узел», но я понятия не имею, как это исправить.1030 *

Опять же, я исследовал эту ошибку, но не смог ее исправить.

Я попробовал другие способы преобразования keras в .pb, чтобы выяснить, не может ли это быть причиной ошибки,но они также потерпели неудачу на шаге 2. Я также попытался преобразовать его из GraphDef из сеанса и с помощью tfile_converter, используя python (а не консоль) - короче говоря, это тоже не сработало.

Яизвестно о этом и этом сообщениях (и многих другихоставленные сообщения), но они отличались от моих.

Спасибо!Любая помощь очень ценится!

...