Survey banner
The Dataiku Community is moving to a new home! We are temporary in read only mode: LEARN MORE

Error in Deep learning in images plugin

Level 3
Error in Deep learning in images plugin

Hi Team.

I am following below link to achieve emotion analysis -

I performed 10 epochs with 10 steps in every epochs while using 'Retraining image classification model'

I am getting following error while using 'Image classification'. kindly help us to solve this error



0 Kudos
23 Replies

The processor is iterating on each row but your predictor does not output probas for every emotion on every line.
I added a if statement to check if the emotion is in the prediction

import json
def process(row):
         max_val = 0
         max_label = None

         emotions = ['calm', 'sad', 'surprised', 'neutral',  'fearful', 'angry', 'happy', 'disgust']

         for e in emotions:
            if e in json.loads(row['prediction']):
                p = float(json.loads(row['prediction'])[e])
                if p > max_val:
                      max_val = p
                      max_label = e

        row['max_prediction'] = max_val
        row['max_label'] = max_label
        row['label'] = row['images'].split('_')[1]
        row['correct'] = 1 if row['label'] == row['max_label'] else 0
        row['video_path'] = '/{}.mp4'.format(row['images'].split('_')[0])

        return row
0 Kudos
Level 1

Alternatively, you can adjust the scoring recipe to provide all 8 classification labels as outputs.

0 Kudos
Level 3

Thanks a lot Arnaud for your extended help. I completed the entire pipeline 

0 Kudos