Failed to find any matching files for ./checkpoints/yolov3_custom
Hi,
thanks a lot for your great tutorial.
I followed your tutorial (https://pylessons.com/YOLOv3-TF2-GoogleColab/) to train a custom dataset on Google Colab. Everything worked without an error and after training completion it shows me this result:
41.071% = Bus AP
0.000% = Car AP
0.000% = Person AP
3.846% = Traffic_light AP
12.857% = Traffic_sign AP
10.000% = Truck AP
0.000% = Vehicle_registration_plate AP
mAP = 9.682%, 17.51 FPS
Now an error occurs:
When I do this command:
yolo = Create_Yolo(input_size=YOLO_INPUT_SIZE, CLASSES=TRAIN_CLASSES)
yolo.load_weights("./checkpoints/yolov3_custom") # use keras weights
It shows me this error:
RuntimeError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/tensorflow/python/training/py_checkpoint_reader.py in NewCheckpointReader(filepattern) 94 try: ---> 95 return CheckpointReader(compat.as_bytes(filepattern)) 96 # TODO(b/143319754): Remove the RuntimeError casting logic once we resolve the
RuntimeError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for ./checkpoints/yolov3_custom
During handling of the above exception, another exception occurred:
NotFoundError Traceback (most recent call last) 3 frames /usr/local/lib/python3.6/dist-packages/tensorflow/python/training/py_checkpoint_reader.py in error_translator(e) 33 'Failed to find any ' 34 'matching files for') in error_message: ---> 35 raise errors_impl.NotFoundError(None, None, error_message) 36 elif 'Sliced checkpoints are not supported' in error_message or ( 37 'Data type '
NotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for ./checkpoints/yolov3_custom
I don't know why the new weights are not saved in the checkpoints folder. As you recommended, I tested the training on my local PC first and everything worked on that.
Could you help me with this problem?
Best regards chris
This is my configs.py file:
#================================================================
File name : configs.py
Author : PyLessons
Created date: 2020-08-18
Website : https://pylessons.com/
GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3
Description : yolov3 configuration file
#================================================================
YOLO options
YOLO_TYPE = "yolov3" # yolov4 or yolov3 YOLO_FRAMEWORK = "tf" # "tf" or "trt" YOLO_V3_WEIGHTS = "model_data/yolov3.weights" YOLO_V4_WEIGHTS = "model_data/yolov4.weights" YOLO_V3_TINY_WEIGHTS = "model_data/yolov3-tiny.weights" YOLO_V4_TINY_WEIGHTS = "model_data/yolov4-tiny.weights" YOLO_TRT_QUANTIZE_MODE = "INT8" # INT8, FP16, FP32 YOLO_CUSTOM_WEIGHTS = False # "checkpoints/yolov3_custom" # used in evaluate_mAP.py and custom model detection, if not using leave False # YOLO_CUSTOM_WEIGHTS also used with TensorRT and custom model detection YOLO_COCO_CLASSES = "model_data/coco/coco.names" YOLO_STRIDES = [8, 16, 32] YOLO_IOU_LOSS_THRESH = 0.5 YOLO_ANCHOR_PER_SCALE = 3 YOLO_MAX_BBOX_PER_SCALE = 100 YOLO_INPUT_SIZE = 416 if YOLO_TYPE == "yolov4": YOLO_ANCHORS = [[[12, 16], [19, 36], [40, 28]], [[36, 75], [76, 55], [72, 146]], [[142,110], [192, 243], [459, 401]]] if YOLO_TYPE == "yolov3": YOLO_ANCHORS = [[[10, 13], [16, 30], [33, 23]], [[30, 61], [62, 45], [59, 119]], [[116, 90], [156, 198], [373, 326]]]
Train options
TRAIN_YOLO_TINY = True TRAIN_SAVE_BEST_ONLY = True # saves only best model according validation loss (True recommended) TRAIN_SAVE_CHECKPOINT = False # saves all best validated checkpoints in training process (may require a lot disk space) (False recommended) #TRAIN_CLASSES = "mnist/mnist.names" #ORIGINAL 16.02. TRAIN_CLASSES = "model_data/Dataset_names.txt" #TRAIN_ANNOT_PATH = "mnist/mnist_train.txt" #ORIGINAL 16.02. TRAIN_ANNOT_PATH = "model_data/Dataset_train.txt" TRAIN_LOGDIR = "log" TRAIN_CHECKPOINTS_FOLDER = "checkpoints" TRAIN_MODEL_NAME = f"{YOLO_TYPE}_custom" TRAIN_LOAD_IMAGES_TO_RAM = True # With True faster training, but need more RAM TRAIN_BATCH_SIZE = 4 TRAIN_INPUT_SIZE = 416 TRAIN_DATA_AUG = True TRAIN_TRANSFER = True TRAIN_FROM_CHECKPOINT = False # "checkpoints/yolov3_custom" TRAIN_LR_INIT = 1e-4 TRAIN_LR_END = 1e-6 TRAIN_WARMUP_EPOCHS = 2 TRAIN_EPOCHS = 10 # default 100
TEST options
#TEST_ANNOT_PATH = "mnist/mnist_test.txt" #ORIGINAL 16.02. TEST_ANNOT_PATH = "model_data/Dataset_test.txt" TEST_BATCH_SIZE = 4 TEST_INPUT_SIZE = 416 TEST_DATA_AUG = False TEST_DECTECTED_IMAGE_PATH = "" TEST_SCORE_THRESHOLD = 0.3 TEST_IOU_THRESHOLD = 0.45
#YOLOv3-TINY and YOLOv4-TINY WORKAROUND if TRAIN_YOLO_TINY: YOLO_STRIDES = [16, 32, 64]
YOLO_ANCHORS = [[[10, 14], [23, 27], [37, 58]], [[81, 82], [135, 169], [344, 319]], [[0, 0], [0, 0], [0, 0]]]