Kshitijpawar / License_Plate_Detection

License Plate Detection and OCR
Other
1 stars 7 forks source link

Attempt to get argmax of an empty sequence #5

Open zhizzha opened 2 years ago

zhizzha commented 2 years ago

I was running License Plate Detection notebook in colab and after running this cell:

`# Exporting the freezed training .pb file

This model will be used later on to perform inference

import re import numpy as np

output_directory = './fine_tuned_model'

lst = os.listdir(model_dir) 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(model_dir, last_model) print(last_model_path) !python /content/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}`

Got this error:

`ValueError Traceback (most recent call last) in () 10 lst = [l for l in lst if 'model.ckpt-' in l and '.meta' in l] 11 steps=np.array([int(re.findall('\d+', l)[0]) for l in lst]) ---> 12 last_model = lst[steps.argmax()].replace('.meta', '') 13 14 last_model_path = os.path.join(model_dir, last_model)

ValueError: attempt to get argmax of an empty sequence`

What should I do?

Kshitijpawar commented 2 years ago

Did your model training start? I was able to reproduce this error when I deleted all the files from /content/models/research/training/, which means the model was not saved