sorenbouma/keras-oneshot

Key Error

Closed this issue · 1 comments

Please see the last line in the code below. starts_idx and end_idx are not even used. Shouldn't the last line be commented out?

   if language is not None:
        low,high = self.categories[s][language]
        try:
            categories = rng.choice(range(low,high),size=(N,),replace=False)
        except ValueError:
            print("this language doesn't have enough characters for that one-shot task")    
        indices = rng.randint(0,self.n_examples,size=(N,))
    else:
        categories = rng.choice(range(n_classes),size=(N,),replace=False)
        start_idx, end_idx =self.categories[s][language]  # <--- language is None here and causes an error

Not sure what I was thinking here, but I've fixed it now.