RamyE / SFU_ML

SFU MSE ML Course Labs and Tools
MIT License
0 stars 3 forks source link

GUI_Reading Model Error #10

Open Adlinalwyn opened 3 years ago

Adlinalwyn commented 3 years ago

Hi Ramy,

Hope you are well. This is an error I am getting, can you please let me know if this is a GUI issue or something else. Thanks.

Screen Shot 2021-03-05 at 12 29 20 PM
hojinchang commented 3 years ago

Hello Ramy,

I am having the same issue.

cljang commented 3 years ago

Hello Ramy,

I am having a similar issue, but my log does not mention the Buffer mismatch.

Also I note that my Lab 1 model still works correctly, so I do not believe that it is a connection error with the RPi.

outputLog.txt

RamyE commented 3 years ago

@cljang If it doesn't mention the reason of the failure, it is likely that you have quite an old version, please use git pull in your GUI folder

RamyE commented 3 years ago

As for the buffer dtype mismatch, can you confirm that you're training the model using a 32-bit machine or a 32-bit virtual env?

RamyE commented 3 years ago

This problem looks similar to this: https://stackoverflow.com/questions/21033038/scikits-learn-randomforrest-trained-on-64bit-python-wont-open-on-32bit-python

cljang commented 3 years ago

Hi Ramy,

I tried to git pull yesterday, so my git is Already up to date.

RamyE commented 3 years ago

@cljang sorry, this was actually an RPi_script update, you will need to git pull in the folder on the RPi, or go to Utilities-> Update RPi Script from the GUI (that second option may not work on the old version though but you can try)

hojinchang commented 3 years ago

I am using

image

RamyE commented 3 years ago

@zipal12671 Please take a look at this: https://github.com/RamyE/SFU_ML#notes

hojinchang commented 3 years ago

Ok, I will try that thank you. This is weird because I used the same setup for Lab 1 and it worked perfectly fine.

cljang commented 3 years ago

So I used Utilities-> Update RPi Script from the GUI, which I believe worked correctly. Instead of it saying that there is a Problem opening the current model, it now has an error with lab selection. It makes multiple attempts to send the command SELECT_LAB with payload Lab2

outputLog2.txt

Edit: Don't use Utilities-> Update RPi Script from the GUI

RamyE commented 3 years ago

Are you sure it worked correctly? Also you need to reboot the RPi after running the command. If you did, this is probably cause the RPi hasn't fully rebooted yet and you just need to wait a minute or two (refer to: https://github.com/RamyE/SFU_ML/blob/master/Ui_project/manual.md#the-gui-is-running-but-i-keep-getting-errors)

cljang commented 3 years ago

So I checked my RPi in PuTTY, went to SFU_ML, and tried to git pull and got the following error:

error: object file .git/objects/b6/d218ccaa3a5ee34969641828a647fcbcd709f5 is empty fatal: loose object b6d218ccaa3a5ee34969641828a647fcbcd709f5 (stored in .git/objects/b6/d218ccaa3a5ee34969641828a647fcbcd709f5) is corrupt

I assume this means something is broken with my cloned repo and that the Update RPi Script in GUI didn't work.

How can I reset the state of my RPi cloned repo? git reset?

Edit: My Lab 1 also does not work anymore

RamyE commented 3 years ago

I am not a git expert, so google may be your best friend here :D You can try git reset --hard. Worst case scenario just delete your SFU_ML directory and clone it again using the relevant steps here: https://github.com/RamyE/SFU_ML/blob/master/Ui_project/manual.md#14-clone-the-python-script

cljang commented 3 years ago

Okay, I deleted and recloned the repo which got me back to where I started, and then I followed the instructions to run a 32 bit python environment to pickle the models. Now my model is correctly working.

Thanks.

Adlinalwyn commented 3 years ago

@RamyE @cljang I did create a 32 bit environment and it launches but for the model what's the version of Notebook compatible with 32 bit env as that's the error I'm getting. Or should I change anything in the command when saving the model on a 64 bit base root?

Screen Shot 2021-03-06 at 3 11 33 PM Screen Shot 2021-03-06 at 3 17 06 PM
RamyE commented 3 years ago

I haven't used a jupyter notebook with 32-bit env before so not sure, but you can probably just use a python script (no need for a jupyter notebook). I also don't understand when did you get this error?

Adlinalwyn commented 3 years ago

Oh I got the error "Unsatisfiable Error" on the Anaconda Application. I'm facing another issue now, I have trained the model on my pi and saved the model file but the GUI throws in this error. ![Uploading Screen Shot 2021-03-06 at 5.59.00 PM.png…]()

Adlinalwyn commented 3 years ago
Screen Shot 2021-03-06 at 5 59 00 PM
Adlinalwyn commented 3 years ago

I see why the error has come so, the Model file has this in it. Any thoughts?

Screen Shot 2021-03-06 at 6 19 21 PM
RamyE commented 3 years ago

can you try to update (git pull) the RPi script?

Also, what were you trying to do when you got the "Unsatisfiable Error". That is what I meant by "when"

Adlinalwyn commented 3 years ago

When I got the "Unsatisfiable Error" i was trying to install JupyterNB for the specific 32-bit environment ml_course32.

I did update the RPi script. Tried again, still same error - also FYI i need to comment out the following lines in the main.py on my mac to ensure it works - 159, 446-451.

Screen Shot 2021-03-06 at 7 12 25 PM
RamyE commented 3 years ago

I guess Jupyter NB may not be available for the 32-bit environment then. You can still just use a .py script and run it directly using python script_name.py after conda activate ml_course_32 or whatever your environment name is

As for the problem, it seems that it is a version incompatibility issue according to this https://github.com/ageitgey/face_recognition/issues/1262 Just make sure you have the same version of sklearn where you trained the model and where you're running it because they changed the naming from classification to _classification

Adlinalwyn commented 3 years ago

Hi Ramy, So after a lot of uninstalling, installing, recloning and help from almost all your links, my model is working, thank you so much.