I’ve recently purchased the latest N6 board and I’m trying to get my old RT1062 code working on the new board. I was using a FOMO model that I trained with Edge impulse, and quantized at INT8. Is there something I need to do to get this model working on the new N6 board? If I run it as is I get the Failed to load error. I tried to use the ‘Convert Model for NPU’ tool within the ‘Machine Vision’ dropdown menu and this causes the board to disconnect and reconnect but there is no error message.
This is the code I’m using to load the model at the moment that Edge impulse provides
try:
net = ml.Model("TrainedModel.tflite", load_to_fb=uos.stat('TrainedModel.tflite')[6] > (gc.mem_free() - (64*1024)))
except Exception as e:
raise Exception('Failed to load "TrainedModel.tflite", did you copy the .tflite and labels.txt file onto the mass-storage device? (' + str(e) + ')')
try:
labels = [line.rstrip('\n') for line in open("labels.txt")]
except Exception as e:
raise Exception('Failed to load "labels.txt", did you copy the .tflite and labels.txt file onto the mass-storage device? (' + str(e) + ')')
I’m using version 4.8.8. I tried following these steps but it still does the same thing. If I reopen the ROMSF I can see the model there but the device still disconnects and then reconnects when I try to run my code. Any suggestions?
When using the Write to ROM tool, it asks you for model conversion. The conversion is successful, based on the log, but the original model is actually written to the ROM.
The solution is to convert the model using OpenMV → Tools → Machine Vision → Convert Model for NPU. Save this converted model, and then use the ROM writing tool. It works fine after that.