MSPM0G5187: quesiton about Char recognition AI model

Part Number: MSPM0G5187

Hi,

My customer wants to change char pattern (not 0-9) from Char recognition in MSPM0G5187 reference design.

I check below. 

https://github.com/TexasInstruments/tinyml-tensorlab/tree/r1.2

image.png

for 1, customer can modify below file.

https://github.com/TexasInstruments/tinyml-tensorlab/blob/r1.2/tinyml-modelmaker/examples/MNIST_image_classification/config_image_classification_mnist.yaml

for 2, I cannot find the example for char recognition or I miss something.

image.png

can you show me where I can find it?

 

BR,

frank

 

 

  • Hi Frank, I see that the customer wants to modify the input parameters of the model.

    There is no specific example that exists for changing the model parameters in image classification. They can use the screenshot that you have shown in 2, and modify any of the parameters of the image classification model such as:

    input_features=(28,28), variables=1, num_classes=10, with_input_batchnorm=True

    This can be a part of the yaml file like the ones in your second screenshot. Once you have created this file, say "model_config.yaml"; you can use this config in Line 27 of  the https://github.com/TexasInstruments/tinyml-tensorlab/blob/r1.2/tinyml-modelmaker/examples/MNIST_image_classification/config_image_classification_mnist.yaml

    And then use it as model_config: /path/to/model_config.yaml

    Regards,

    Adithya

  • Adithya,

    i modify model_config.yaml as below.

    input_features:(28,28)
    variables:1
    num_classes:10
    with_input_batchnorm:True

    but it shows error below.

    Traceback (most recent call last):
    File "C:\Users\a0219317\Downloads\tinyml-tensorlab-r1.2 (1)\tinyml-tensorlab-r1.2\tinyml-modelmaker\tinyml_modelmaker\run_tinyml_modelmaker.py", line 156, in <module>
    main(config)
    File "C:\Users\a0219317\Downloads\tinyml-tensorlab-r1.2 (1)\tinyml-tensorlab-r1.2\tinyml-modelmaker\tinyml_modelmaker\run_tinyml_modelmaker.py", line 96, in main
    model_runner.run()
    File "C:\ti\Python310\lib\site-packages\tinyml_modelmaker\ai_modules\vision\runner.py", line 191, in run
    self.model_training.run()
    File "C:\ti\Python310\lib\site-packages\tinyml_modelmaker\ai_modules\vision\training\tinyml_tinyverse\image_classification.py", line 404, in run
    train.run(args)
    File "C:\ti\Python310\lib\site-packages\tinyml_tinyverse\references\image_classification\train.py", line 672, in run
    main(0, args)
    File "C:\ti\Python310\lib\site-packages\tinyml_tinyverse\references\image_classification\train.py", line 501, in main
    model = models.get_model(
    File "C:\ti\Python310\lib\site-packages\tinyml_tinyverse\common\models\__init__.py", line 83, in get_model
    model_config_dict.update(dict(variables=variables, num_classes=num_classes, with_input_batchnorm=with_input_batchnorm, input_features=input_features, dual_op=dual_op))
    AttributeError: 'str' object has no attribute 'update'

    Any idea?

    BR,

    frank

  • Did you also pass the following under the 'training' section of the config_image_classification_mnist.yaml

    model_config: /path/to/model_config.yaml

  • Adithya,

    i only add below.

    model_config: .\examples\MNIST_image_classification\model_config.yaml
    I change the num_classes to 2 and it can pass the compilation.

    input_features: (28,28)
    variables: 1
    num_classes: 2
    with_input_batchnorm: True
    I change it back to 10 and it can pass the compilation.

    input_features: (28,28)
    variables: 1
    num_classes: 10
    with_input_batchnorm: True
    so, I think that it works now.
    BR,
    frank
  • Hi frank, num_classes is usually inferred from the dataset itself. If this was the only parameter you wanted to change, having 10 classes in the dataset should have done it, without requiring you to change this.