Dohyun Kim 2018. 4. 13. 04:59

'NoneType' object is not iterable


코드:

   def get_trainset_asnumpy(self):
        if(type == 10 ):
            return dict[b'data'] , dict[b'labels'], dict[b'labels']
        elif(type == 100):
            return dict[b'data'],dict[b'fine_labels'],  dict[b'coarse_labels']
        else:
            return None




에러:

     train_X , train_Y_, _ = dataset_maker.get_trainset_asnumpy()
TypeError: 'NoneType' object is not iterable



self.type 으로 썼어야 했는데 그냥 type으로 써서 생긴 문제였다.

매번 실수하니까