Я пытаюсь преобразовать замороженный граф вывода DeepLab , размещенный в их модельном зоопарке , с использованием tfjs преобразователя .
Преобразование былоуспешно, но когда я загружаю модель, я получаю следующий вывод:
Error importing the graph: block_shape must be positive for 'MobilenetV2/expanded_conv_7/depthwise/depthwise/SpaceToBatchND' (op: 'SpaceToBatchND') with input shapes: [1,?,?,384], [2], [2,2] and with computed input tensors: input[1] = <0 0>, input[2] = <[0 0][0 0]>.
Process finished with exit code 2
Я попытался преобразовать замороженный граф mobilenet и затем загрузить его, это было успешно.Скрипт, который я использую для загрузки конвертированной модели:
graph_def = None
graph = None
model_file = "tensorflowjs_model.pb"
print('Loading graph definition ...', file=sys.stderr)
try:
with tf.gfile.GFile(model_file, "rb") as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
except BaseException as e:
parser.exit(2, 'Error loading the graph definition: {}'.format(str(e)))
print('Importing graph ...', file=sys.stderr)
try:
assert graph_def is not None
with tf.Graph().as_default() as graph: # type: tf.Graph
tf.import_graph_def(
graph_def,
name=''
)
except BaseException as e:
parser.exit(2, 'Error importing the graph: {}'.format(str(e)))