I completed the cats vs. dogs assignment and achieved 97.29% training accuracy with an 85.96% validation accuracy by the 15th epoch. However, when I submitted, I got the following error with my submission:
There was a problem compiling the code from your notebook. Details:
No module named 'keras.optimizers.legacy'; 'keras.optimizers' is not a package
I believe the objectionable code was:
from keras.optimizers.legacy.rmsprop import RMSProp
I also tried a variation that didn’t depend upon the legacy package -
from keras.optimizers.rmsprop import RMSprop as RMSProp
and this time got a final result of training accuracy: 99.31% and validation accuracy of 86.96%. But still received the same error from the grader (this was, perhaps, predictable, since I was still treating keras.optimizers as a package).
However, the original import statement:
from keras.optimizers.legacy.rmsprop import RMSProp
was supplied as part of the project.
How should I compensate for the fact that the grading software can’t seem to perform that import, even though it works when I run in the given Colab environment?
Grader Result:
Output from Colab: