Arsey/keras-transfer-learning-for-oxford102

dict().values returns dict_values in python 3.6

jszym opened this issue · 1 comments

jszym commented

When calling the .values method on a dict() object in python 3.6, a dict_values is returned, not a list as was the case in earlier versions.

This causes an error in the vis.utils.get_class_weight method in python 3.6. To fix this, you need to change

total = np.sum(class_number.values())
max_samples = np.max(class_number.values())

to

total = np.sum(list(class_number.values()))
max_samples = np.max(list(class_number.values()))

My understanding is that this patch shouldn't affect 2.* versions of python.

@jszym, Thanks man. I confirm your proposed change works with Python 3.5 as well