How to validate with fp16 models

Running learn.validate() has no problem but if i do learn.to_fp16() and then learn.validate(), I get “‘learner’ object has no attribute ‘opt’”. How can I solve this problem?

Just run learn.create_opt(lr=a_value) for the Learner to have an optimizer.

Note that this is a bug we didn’t really bother fixing because people usually do inference in FP32, so this happening was a reminder of a problem.