OSError: Could not find the file for module nn

When i tried to run the cifar10 network program,it is showing the following error. How can i solve this.
OSError: Could not find the file.
nn.load(’/cifar10.network’)

You need to put the network on the OpenMV Cam’s disk. That said, the cifar10 net doesn’t run on the OpenMV Cam M7. You can run the cifar10 fast net on the OpenMV Cam.

If you want to do that, please add softmax=True to the nn.forward() call.

Hello,

I am new to openmv. I am interested to test nn with openmv. The first thing I try to do is download the smile.network, but I can not copy this network into the disk. When I connect the openmv cam to the windows pc, it is showing “0 Byte free of 79.0K byte”.

Regards,

Baozhu

Hi, use an SD card.

Hi, Thanks, I just put 8G SD card.

I can now downloaded cifar10.network/cifar10_fast.network and copy into the disk, and try the example code

net = nn.load(’/cifar10_fast.network’)
labels = [‘airplane’, ‘automobile’, ‘bird’, ‘cat’, ‘deer’, ‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’]

clock = time.clock()
while(True):
clock.tick()

img = sensor.snapshot()

for obj in net.search(img, threshold=0.6, min_scale=0.4, scale_mul=0.8,
x_overlap=0.5, y_overlap=0.5, contrast_threshold=0.5):
print(“Detected %s - Confidence %f%%” % (labels[obj.index()], obj.value()))
img.draw_rectangle(obj.rect(), color=(255, 0, 0))
print(clock.fps())


But the results are always :
First layer is NULL!
First layer is NULL!
49.31507
First layer is NULL!
First layer is NULL!

Where can be the problem, please? The network downloaded from the githup is not a already trained network?

Regards,

Baozhu

Looks like the file may be corrupted or you didn’t download the file from github. You have to download the raw file:

https://raw.githubusercontent.com/openmv/openmv/master/ml/cmsisnn/models/cifar10_fast/cifar10_fast.network


Also make sure the file is written before resetting the camera (safely remove the disk if you have to).

Thanks iabdalkader, I copy the network you give into the disk and now it works.

Regards,

Baozhu