MaixPy-v1 icon indicating copy to clipboard operation
MaixPy-v1 copied to clipboard

Maixpy Error 13 Help !

Open Demet95 opened this issue 4 years ago • 19 comments

Hey everbody. I followed a racoon detector tutorial and when i tried to test it i just got and error in the code.The kmodel is fine i think but for some reason i just got: Traceback (most recent call last):

File "", line 21, in OSError: run error: 13 MicroPython v0.5.0-29-g97fad3a on 2020-03-13; Sipeed_M1 with kendryte-k210 Type "help()" for more information.

I follow this script :https://github.com/AIWintermuteAI/aXeleRate/blob/master/example_scripts/k210/detector/racoon_detector.py

and just modify the While cycle due an error with these lines : .rotation_corr(z_rotation=90.0) a = img.pix_to_ai()

I'll really appreciate any help.

Demet95 avatar Aug 24 '20 04:08 Demet95

show your full code

Neutree avatar Aug 24 '20 06:08 Neutree

It's pretty likely you don't have your model loaded at 0x200000. See this line: task = kpu.load(0x200000)

You need to either load the model from the (easy method) SD card (see the comment: #change to "/sd/name_of_the_model_file.kmodel" if loading from SD card) or flash the model to the boards memory at the correct memory point.

nlothian avatar Aug 24 '20 06:08 nlothian

show your full code

Hi , @Neutree this is my code. I verfied my model loaded and its good. Error

Demet95 avatar Aug 24 '20 06:08 Demet95

@Demet95 try the latest firmware in master branch https://dl.sipeed.com/MAIX/MaixPy/release/master/

Neutree avatar Aug 24 '20 08:08 Neutree

@Neutree Hey now im just got this error when i used the latest firmware: image

Demet95 avatar Aug 24 '20 17:08 Demet95

visit https://www.maixhub.com/compile.html , and compile a support v4 model firmware

image

Neutree avatar Aug 25 '20 01:08 Neutree

@Neutree Hi , i just did it and no errors where found but, the code it's not working and the other strange thing is that the MaixGo got disconnecting from de IDE by itself. This is what the terminal showed me : image

Demet95 avatar Aug 25 '20 02:08 Demet95

use terminal tool to connect board, and run

Neutree avatar Aug 25 '20 08:08 Neutree

@Neutree Hi i did it and showed me this: image I don't know what the problem is, but i suppose that it's because the k model?

Demet95 avatar Aug 25 '20 14:08 Demet95

it maybe a bug, but you should show your firmware's version

Neutree avatar Aug 26 '20 02:08 Neutree

and it's better put your model here if you can share it

Neutree avatar Aug 26 '20 02:08 Neutree

Hey @Neutree these are my model and firmware as u request. I really apreciate all the help that you are giving to me

Model.zip

Demet95 avatar Aug 26 '20 05:08 Demet95

I tried this model with latest commit, it can be load, but memory seems not enough,

#tested with frimware 5-0.22
import sensor,image
import KPU as kpu

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((224, 224))
sensor.set_vflip(1)
sensor.run(1)
classes = ["racoon"]
task = kpu.load(0x300000) #change to "/sd/name_of_the_model_file.kmodel" if loading from SD card
a = kpu.set_outputs(task, 0, 7,7,30)   #the actual shape needs to match the last layer shape of your model(before Reshape)
anchor = (0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828)
a = kpu.init_yolo2(task, 0.3, 0.3, 5, anchor) #tweak the second parameter if you're getting too many false positives
while(True):
    img = sensor.snapshot().rotation_corr(z_rotation=90.0)
    a = img.pix_to_ai()
    code = kpu.run_yolo2(task, img)
    if code:
        for i in code:
            a=img.draw_rectangle(i.rect(),color = (0, 255, 0))
            a = img.draw_string(i.x(),i.y(), classes[i.classid()], color=(255,0,0), scale=3)
a = kpu.deinit(task)

maixpy.bin.zip

Neutree avatar Aug 26 '20 08:08 Neutree

@Neutree So what do u recommend? try it with a SD?

Demet95 avatar Aug 26 '20 14:08 Demet95

I run the script again (from the terminal) with the firmware or uploaded in the zip file. I just got what the image says, and i really don't understand why the mismatch between the shapes , i just followed this tutorial: https://www.youtube.com/watch?v=87c6dCgXeJo&lc=UgwRad8j1nV94reFwz94AaABAg.9CiZCaIO5QL9CmEylVQAZI

image

Demet95 avatar Aug 26 '20 16:08 Demet95

If you are following the tutorial, the shape should match - you can see it during the training The problem you're experiencing is referenced in this issue: https://github.com/AIWintermuteAI/aXeleRate/issues/10

AIWintermuteAI avatar Aug 31 '20 09:08 AIWintermuteAI

Hi @AIWintermuteAI i tried what u post me and I could fix that error. However, i got this : image line 25 refer to : a = img.draw_string(i.x(),i.y(), classes[i.classid()], color=(255,0,0), scale=3)

Can you help me? I don't know if this is cause the firmware. Other thing to consider i think is that in the screen of the board i got this : image The red part is the initialization of the IDE firmware , looks like a bug but i dont really know. After a few seconds the code is running goes the above error.

Edit: I'm working on the Google Colab

Demet95 avatar Aug 31 '20 16:08 Demet95

What is your model? It is not racoon detector, isn't it? Seems like the number of classes you specified here

classes = ["racoon"]

does not match the number of classes output by the model. Thus my question - what is your model? If you modified the model, then make sure you spend time to understand how to modify the code and change the relevant parts.

AIWintermuteAI avatar Sep 01 '20 01:09 AIWintermuteAI

@AIWintermuteAI U r so right and I'm so ashamed that i did not even noticed it. Im new into this world and im learning the basics yet. But with all these mistakes i think ill improve. I have one more question if u allow me : Do u think is possible to do an ANPR on the Maix?

I could run both's models , thanks so much for help

Demet95 avatar Sep 01 '20 03:09 Demet95