OSError: Could not find the file for module nn

Discussion related to "under the hood" OpenMV topics.
krishnakumar77777
Posts: 16
Joined: Mon Oct 15, 2018 6:34 am

OSError: Could not find the file for module nn

Postby krishnakumar77777 » Tue Oct 16, 2018 3:24 am

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')
User avatar
kwagyeman
Posts: 2467
Joined: Sun May 24, 2015 2:10 pm

Re: OSError: Could not find the file for module nn

Postby kwagyeman » Tue Oct 16, 2018 10:13 am

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.
Nyamekye,
BAOZHU
Posts: 3
Joined: Sat Dec 08, 2018 5:39 pm

Re: OSError: Could not find the file for module nn

Postby BAOZHU » Sat Dec 08, 2018 5:45 pm

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
User avatar
iabdalkader
Posts: 634
Joined: Sun May 24, 2015 3:53 pm

Re: OSError: Could not find the file for module nn

Postby iabdalkader » Sat Dec 08, 2018 7:13 pm

BAOZHU wrote:
Sat Dec 08, 2018 5:45 pm
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.
BAOZHU
Posts: 3
Joined: Sat Dec 08, 2018 5:39 pm

Re: OSError: Could not find the file for module nn

Postby BAOZHU » Tue Dec 11, 2018 5:02 pm

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
User avatar
iabdalkader
Posts: 634
Joined: Sun May 24, 2015 3:53 pm

Re: OSError: Could not find the file for module nn

Postby iabdalkader » Tue Dec 11, 2018 9:41 pm

BAOZHU wrote:
Tue Dec 11, 2018 5:02 pm
But the results are always :
First layer is NULL!
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/openm ... st.network


Also make sure the file is written before resetting the camera (safely remove the disk if you have to).
BAOZHU
Posts: 3
Joined: Sat Dec 08, 2018 5:39 pm

Re: OSError: Could not find the file for module nn

Postby BAOZHU » Wed Dec 12, 2018 2:05 am

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

Regards,,

Baozhu

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest