TFLITE model maker DataLoader.from_csv returns a None type

i am trying to load my datasets using a csv file using the DataLoader.from_csv('path to csv', images_dir = 'path to image directory) however when i go on to start training training the model i get an error AttributeError: 'NoneType' object has no attribute 'label_map'. it seems like whatever from returned from Dataloader.from_csv` was a None type

Hi @Ebyau_Bryan ! Can you show the code you are using to load the data. The function returns None only if it doesn’t find correct train, training,test data in the CSV.

This is my code for loading data from csv

from tflite_model_maker.object_detector import DataLoader

train_dir = '/content/drive/MyDrive/Training_demo/images/my_dataset/train'

train_data, validation_data, test_data = DataLoader.from_csv('/content/drive/MyDrive/Training_demo/annotations/train_dataset.csv', images_dir = train_dir)

@Ebyau_Bryan there should be no error if train_dir and train_dataset.csv exist. could you try loading the csv to pandas dataframe.

import pandas as pd
mycsv = pd.read_csv ('path')
mycsv.head()

and check if csv has loaded correctly

the csv file loads successfully,

it would be nice if I could see your collab file. Sorry, I should have asked about this earlier it would have been easier and faster for you.

alright this is link to my colab notebook
Colab notebook

@Ebyau_Bryan It works just fine for me on my dummy dataset… I don’t have your csv file or data but it seems like it is not in the format DataLoader is expecting pls look into Formatting a training data CSV | AutoML Vision Object Detection (google.com)

Alright . Are there scripts to format data into the required format for DataLoader otherthan using Google cloud AutoML Object Detection