Error in Deep learning in images plugin

Swapnali
Level 3
Error in Deep learning in images plugin

Hi Team.

I am following below link to achieve emotion analysis - https://www.phdata.io/dataiku-deep-learning-tutorial-emotion-classification-in-videos/

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

eaerr.PNG 

 

0 Kudos
23 Replies
arnaudde
Dataiker

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
robertcoop
Level 1

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

0 Kudos
Swapnali
Level 3
Author

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

0 Kudos