ValueError: попытка получить argmax пустой последовательности Kaggle - PullRequest
0 голосов
/ 19 мая 2019

Итак, я читал учебник по созданию приложения TensorFlow Lite и столкнулся с этой проблемой.

import re
import numpy as np

output_directory = '/kaggle/working/trained_model'

lst = os.listdir(train)
lst = [l for l in lst if 'model.ckpt-' in l and '.meta' in l]
steps=np.array([int(re.findall('\d+', l)[0]) for l in lst])
last_model = lst[steps.argmax()].replace('.meta', '')
last_model_path = os.path.join(train, last_model)

print(last_model_path)
!python /kaggle/working/models/research/object_detection/export_inference_graph.py \
    --input_type=image_tensor \
    --pipeline_config_path={pipeline_fname} \
    --output_directory={output_directory} \
    --trained_checkpoint_prefix={last_model_path} \
    > /kaggle/working/graph.txt
print('Finished exporting')

Ошибка:

ValueError Traceback (самый последний вызов последний) в () 8 lst = [l для l в lst, если 'model.ckpt-' в l и '.meta' в l] 9 шагов = np.array ([int (re.findall ('\ d +', l) [0]) для l в lst]) ---> 10 last_model = lst [steps.argmax ()]. ​​Replace ('. Meta', '') 11 last_model_path = os.path.join (train, last_model) 12

ValueError: попытка получить argmax пустой последовательности

...