Toolkit error (Neuralnet supports only one image typed...)

User 2334 | 10/16/2015, 7:27:03 PM

Hi!

I am trying to use the imagenetmodeliter45 model to extract Features from my csv file.

source = 'test.csv' data = graphlab.SFrame.read_csv(source) image_train,image_test = data.random_split(.8, seed=0) deep_learning_model = graphlab.load_model('http://s3.amazonaws.com/GraphLab-Datasets/deeplearning/imagenet_model_iter45') image_train['deep_features'] = deep_learning_model.extract_features(image_train)

If I try to run the code above, I am getting the following error message:

ToolkitError: Neuralnet supports only one image typed column, or multiple int, float or array typed columns.

My csv file has the Format (example):

ID,image,label,image_array 1,Height: 167 Width: 300,"gus","[221 201 115 222 202 116...]" 2,Height: 167 Width: 300,"gus","[201 201 105 202 202 106...]" ...

I have no idea what could be the Problem. Any help would be very appreciated! ete

Comments

User 940 | 10/16/2015, 10:20:28 PM

Hi @ete,

I'm guessing this is because neural nets require a column of Image type(one of our datatypes), while your csv has only image array's and meta-data.

Would it be possible to share a subset of your .csv to verify this theory? That would make helping you out easier. You can either attach here or send to piotr [at] dato [dot] com.

Thanks! -Piotr


User 2679 | 11/30/2015, 12:14:17 PM

@Ete or @Piotr, could you follow up on your post?

I'm curious how you solved this, as I'm facing a similar issue.


User 940 | 12/2/2015, 9:53:41 PM

Hi @RobRomijnders ,

Could you give some more detail on your issue? This would help us debug.

Cheers! -Piotr


User 2733 | 12/4/2015, 11:56:30 PM

Hi,

I just tried to create a neural net image classifier as my first project with Dato, and I'm getting the same error message. I used graphlab.imageanalysis.loadimages to load a 2-level deep directory of images into an SArray (where the subfolder=label name); the resulting SArray had two columns, "path" and "image". Then I added another column called "label" where I extracted the label names from the path. Then I split the whole thing into a training and validation set and tried to create a model like so:

model = graphlab.neuralnet_classifier.create(training_data, target='label', validation_set=validation_data, metric=['accuracy', 'f1_score', 'precision', 'recall', 'confusion_matrix'], max_iterations=3)

after which I got the error. What did I do wrong?

Thanks, Beata


User 940 | 12/5/2015, 8:46:42 PM

Hi @Beata,

It seems like we only accept a single column when we train a neuralnet classifier on images. However, the line of code you are running tries to use the 'label' as a feature as well. The solution is to pass features=['image'] as one of the parameters of the function call.

Cheers! -Piotr


User 2733 | 12/6/2015, 12:34:47 AM

Hi @piotr,

that worked - thanks so much!

--Beata


User 2679 | 12/6/2015, 6:12:21 PM

@piotr

Thank you for your offered help, Piotr.

For all people searching the topic in future, I'll explain what made it work for me.

For some reason, I got the error again and again. As I grew tired of typing the directory in the Notebook, I copied the .csv file to plain "D:\data.csv". For some magical reason, it suddenly worked.

To fool-proof this solution, I copied the file back: didn't work as before. I copied the file to "D:\data.csv" and it worked.

(Btw, I'm fairly new to this world as I come from Medicine major. This situation adds to my awe and admiration for you guys, developing this libraries. Thanks a lot for making this available!!)