AIWintermuteAI / aXeleRate

Keras-based framework for AI on the Edge
MIT License
174 stars 72 forks source link

Error converting shape #27

Closed spstrademark closed 3 years ago

spstrademark commented 3 years ago

Hello, i tried the tutorial from here https://www.hackster.io/dmitrywat/object-detection-with-sipeed-maix-boards-kendryte-k210-421d55?fbclid=IwAR2mDf91UkdMzAsimB1YjI7XtpLcOB35n-1mGF5yC0eWo8bgNtUExzP8Ti8 but i am facing the following error :

TypeError: Error converting shape to a TensorShape: int() argument must be a string, a bytes-like object or a number, not 'list'.

My OS is : Ubuntu 18.04.5 LTS TF : tensorflow==1.14.0 Keras : 2.1.1

conda create -n yolo python=3.7 conda activate yolo pip install git+https://github.com/AIWintermuteAI/aXeleRate Downloaded : https://github.com/penny4860/Yolo-digit-detector Dataset : https://drive.google.com/file/d/1ncCsJ-8kIXQXpw8DF0T_ZfJBpemv2FI9/view

I had to replace the architecture " MobileNet7_5 " to " MobileNet " because i had the error :

Exception: Architecture not supported! Only support Full Yolo, Tiny Yolo, MobileNet, SqueezeNet, VGG16, ResNet50, and Inception3 at the moment!

JSON config file :

{
    "model" : {
        "type":                 "Detector",
        "architecture":         "MobileNet",
        "input_size":           [224,224],
        "anchors":              [0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828],
        "labels":               ["raccoon"],
        "coord_scale" :         1.0,
        "class_scale" :         1.0,
        "object_scale" :        5.0,
        "no_object_scale" :     1.0
    },
    "weights" : {
        "full":                 "",
        "backend":              "imagenet"
    },
    "train" : {
        "actual_epoch":         50,
        "train_image_folder":   "/mnt/0d2701de-7997-4d53-99fb-0c9de0a116c9/K210_tools/data/imgs",
        "train_annot_folder":   "/mnt/0d2701de-7997-4d53-99fb-0c9de0a116c9/K210_tools/data/anns",
        "train_times":          2,
        "valid_image_folder":   "/mnt/0d2701de-7997-4d53-99fb-0c9de0a116c9/K210_tools/data/imgs_validation",
        "valid_annot_folder":   "/mnt/0d2701de-7997-4d53-99fb-0c9de0a116c9/K210_tools/data/anns_validation",
        "valid_times":          2,
        "valid_metric":         "mAP",
        "batch_size":           4,
        "learning_rate":        1e-4,
        "saved_folder":         "raccoon_detector",
        "first_trainable_layer": "",
        "augumentation":                true,
        "is_only_detect" :      false
    },
    "converter" : {
        "type":                 ["k210"]
    }
}

Thank you for your time! Best regards

AIWintermuteAI commented 3 years ago

Hello! Please do not use or install https://github.com/penny4860/Yolo-digit-detector --- this is an outdated version and it is not supported. Additionally, when you install aXeleRate with pip install git+https://github.com/AIWintermuteAI/aXeleRate it should automatically download and install tensorflow>=1.15.0,<2.0.0 keras==2.3.1 as specified in requirements.txt file here https://github.com/AIWintermuteAI/aXeleRate/blob/master/requirements.txt Earlier versions are not supported. The error that you're getting is related to the fact that you have tried using outdated script with newer config file.

Again, please follow the tutorial exactly and DO NOT download outdated script. That should resolve your problem. Please respond if your issue has been solved.

spstrademark commented 3 years ago

Hello, I managed to get it working with a slightly different approach I did the following commands in order to work: pip install git+https://github.com/AIWintermuteAI/aXeleRate git clone https://github.com/AIWintermuteAI/aXeleRate.git cd aXeleRate cd axelerate python train.py -c ../configs/raccoon_detector.json I am not sure how to use train.py without the 2nd git and cd and i would be thankful if you could explain it please.

Best regards, Stanko Stankov

AIWintermuteAI commented 3 years ago

Ah, I see. There was a bit of confusion here I suppose, I changed the article to say

Install aXeleRate on your local machine with pip install git+https://github.com/AIWintermuteAI/aXeleRate And then run this to download scripts you will need for training and inference: git clone https://github.com/AIWintermuteAI/aXeleRate.git

this now. Currently aXeleRate doesn't have a command line interface, which means that git cloning repository is necessary for training and inference (unless you write your own training script using aXeleRate classes and functions of course).

Glad that everything worked! Closing the issue now.