I got
MemoryError
on my computer, but it is quite weak (it has only 4GB of RAM). When I changed 10000
to 1000
everything works fine, but you have a typo in epochs = range(1, len('acc') + 1)
; it should be epochs = list(range(1, len(history_dict['acc']) + 1))
.